|
|
@ -52,6 +52,10 @@ static void lock_finished_handler(void * data, struct ext_session_lock_v1 * lock
|
|
|
|
int main(void) {
|
|
|
|
int main(void) {
|
|
|
|
// get wl_display, the core object
|
|
|
|
// get wl_display, the core object
|
|
|
|
wl = wl_display_connect(NULL);
|
|
|
|
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
|
|
|
|
// prepare listeners for wl_registry.global
|
|
|
|
struct wl_registry_listener reg_listener = {
|
|
|
|
struct wl_registry_listener reg_listener = {
|
|
|
@ -89,7 +93,7 @@ int main(void) {
|
|
|
|
fprintf(stderr, "BUG!\n");
|
|
|
|
fprintf(stderr, "BUG!\n");
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
} else if (lock_state == FINISHED) {
|
|
|
|
} 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
|
|
|
|
// nothing to do, just destroy stuff
|
|
|
|
ext_session_lock_v1_destroy(lock);
|
|
|
|
ext_session_lock_v1_destroy(lock);
|
|
|
|
} else if (lock_state == LOCKED) {
|
|
|
|
} else if (lock_state == LOCKED) {
|
|
|
|