summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-05-19 17:34:39 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-05-19 17:34:39 +0200
commit3d6bcda15736d32815e46d4a44d9a72fe299c5c9 (patch)
treefab5abc0e4fd847642e19d51221e678bd35786cb /src/drivers
parent642ec5b74b3b86610d1e28841c86d408ac079373 (diff)
Wayland: accept diverse versions of the GTK Shell protocol
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
index 176f27e57..3874717ac 100644
--- a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
+++ b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
@@ -205,8 +205,10 @@ static void pointer_enter(void *data, struct wl_pointer *wl_pointer, uint32_t se
struct wl_surface *surface, wl_fixed_t surface_x, wl_fixed_t surface_y) {
struct Fl_Wayland_Screen_Driver::seat *seat = (struct Fl_Wayland_Screen_Driver::seat*)data;
Fl_Window *win = event_coords_from_surface(surface, surface_x, surface_y);
- static bool using_GTK = true;
- if (!win && seat->gtk_shell && using_GTK) { // check whether surface is the headerbar of a GTK-decorated window
+ static bool using_GTK = seat->gtk_shell &&
+ (gtk_shell1_get_version(seat->gtk_shell) >= GTK_SURFACE1_TITLEBAR_GESTURE_SINCE_VERSION);
+ if (!win && using_GTK) {
+ // check whether surface is the headerbar of a GTK-decorated window
Fl_X *xp = Fl_X::first;
while (xp && using_GTK) { // all mapped windows
struct wld_window *xid = (struct wld_window*)xp->xid;
@@ -1257,10 +1259,8 @@ static void registry_handle_global(void *user_data, struct wl_registry *wl_regis
} else if (strcmp(interface, "gtk_shell1") == 0) {
Fl_Wayland_Screen_Driver::compositor = Fl_Wayland_Screen_Driver::MUTTER;
//fprintf(stderr, "Running the Mutter compositor\n");
- if ( version >= 5) {
- scr_driver->seat->gtk_shell = (struct gtk_shell1*)wl_registry_bind(wl_registry, id,
- &gtk_shell1_interface, 5);
- }
+ scr_driver->seat->gtk_shell = (struct gtk_shell1*)wl_registry_bind(wl_registry, id,
+ &gtk_shell1_interface, version);
} else if (strcmp(interface, "weston_desktop_shell") == 0) {
Fl_Wayland_Screen_Driver::compositor = Fl_Wayland_Screen_Driver::WESTON;
//fprintf(stderr, "Running the Weston compositor\n");