diff --git a/include/wayland-internal.h b/include/wayland-internal.h index b4d2f849f..2c10572c5 100644 --- a/include/wayland-internal.h +++ b/include/wayland-internal.h @@ -129,7 +129,8 @@ struct _wayland_seat { #define WL_SEAT_INTERFACE_MAX_VERSION 8 #define WL_OUTPUT_INTERFACE_MIN_VERSION 2 #define WL_OUTPUT_INTERFACE_MAX_VERSION 4 -#define WL_LAYER_SHELL_INTERFACE_VERSION 1 +#define WL_LAYER_SHELL_INTERFACE_MIN_VERSION 4 +#define WL_LAYER_SHELL_INTERFACE_MAX_VERSION 4 #define WL_KEYBOARD_SHORTCUTS_INHIBITOR_INTERFACE_VERSION 1 extern wayland_stuff *wayland; diff --git a/source/wayland/display.c b/source/wayland/display.c index 2d695cac5..27a96822b 100644 --- a/source/wayland/display.c +++ b/source/wayland/display.c @@ -1291,10 +1291,15 @@ static void wayland_registry_handle_global(void *data, wl_registry_bind(registry, name, &wl_compositor_interface, MIN(version, WL_COMPOSITOR_INTERFACE_VERSION)); } else if (g_strcmp0(interface, zwlr_layer_shell_v1_interface.name) == 0) { + if (version < WL_LAYER_SHELL_INTERFACE_MIN_VERSION) { + g_error("Minimum version of wayland layer shell interface is %u, got %u", WL_LAYER_SHELL_INTERFACE_MIN_VERSION, + version); + return; + } wayland->global_names[WAYLAND_GLOBAL_LAYER_SHELL] = name; wayland->layer_shell = wl_registry_bind(registry, name, &zwlr_layer_shell_v1_interface, - MIN(version, WL_LAYER_SHELL_INTERFACE_VERSION)); + MIN(version, WL_LAYER_SHELL_INTERFACE_MAX_VERSION)); } else if (g_strcmp0(interface, zwp_keyboard_shortcuts_inhibit_manager_v1_interface.name) == 0) { wayland->global_names[WAYLAND_GLOBAL_KEYBOARD_SHORTCUTS_INHIBITOR] = name; wayland->kb_shortcuts_inhibit_manager = @@ -1596,7 +1601,7 @@ static gboolean wayland_display_late_setup(void) { ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT | ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT); zwlr_layer_surface_v1_set_size(wayland->wlr_surface, 0, 0); - zwlr_layer_surface_v1_set_keyboard_interactivity(wayland->wlr_surface, 1); + zwlr_layer_surface_v1_set_keyboard_interactivity(wayland->wlr_surface, 2); zwlr_layer_surface_v1_add_listener( wayland->wlr_surface, &wayland_layer_shell_surface_listener, NULL);