wayland: Fix gtk-shell protocol handling
authorMatthias Clasen <mclasen@redhat.com>
Fri, 4 Aug 2023 11:45:59 +0000 (07:45 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 4 Aug 2023 11:57:33 +0000 (07:57 -0400)
The protocol spec isn't clear about the relationship
between the capability enum and the uint in the capability
event.

Fix things to use the same relationship as mutter.

gdk/wayland/gdkdisplay-wayland.c

index 95c5fa78030c72e5766f8ce893c094fc9e1d1dd5..59e0373c9f2997dc7e5ff89ed0bc2d58c8407e0a 100644 (file)
@@ -2185,8 +2185,9 @@ set_capability_setting (GdkDisplay                *display,
                         enum gtk_shell1_capability test)
 {
   GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
+  int testbit = 1 << (test - 1);
 
-  g_value_set_boolean (value, (display_wayland->shell_capabilities & test) == test);
+  g_value_set_boolean (value, (display_wayland->shell_capabilities & testbit) == testbit);
 
   return TRUE;
 }