A few fixes

master
LEdoian 2 weeks ago
parent 09648a0b71
commit ed838b50b6

@ -2,7 +2,7 @@
CFLAGS:=-lwayland
LDFLAGS:=-lwayland-client
wl_unlocker: unlocker.o session-lock.o
gcc $(LDFLAGS) unlocker.o session-lock.o -o wl_unlocker
gcc -o wl_unlocker unlocker.o session-lock.o $(LDFLAGS)
unlocker.o: unlocker.c session-lock.h

@ -52,6 +52,10 @@ static void lock_finished_handler(void * data, struct ext_session_lock_v1 * lock
int main(void) {
// get wl_display, the core object
wl = wl_display_connect(NULL);
if (wl == NULL) {
fprintf(stderr, "Cannot connect to compositor, no wayland?\n");
return 1;
}
// prepare listeners for wl_registry.global
struct wl_registry_listener reg_listener = {
@ -89,7 +93,7 @@ int main(void) {
fprintf(stderr, "BUG!\n");
return 1;
} else if (lock_state == FINISHED) {
printf("Not locked.\n");
printf("Cannot get lock either another lock is running or not lockable.\n");
// nothing to do, just destroy stuff
ext_session_lock_v1_destroy(lock);
} else if (lock_state == LOCKED) {

Loading…
Cancel
Save