wayland: Use proper macro
authorBenjamin Otte <otte@redhat.com>
Fri, 31 Mar 2023 23:18:38 +0000 (01:18 +0200)
committerBenjamin Otte <otte@redhat.com>
Sat, 1 Apr 2023 00:22:21 +0000 (02:22 +0200)
Wayland has macros to check required versions. Use those instead of
custom ones.

gdk/wayland/gdkprivate-wayland.h
gdk/wayland/gdkseat-wayland.c
gdk/wayland/gdksurface-wayland.c

index e7556898870d5f42023882996d0754eefa434511..73b934d37119e841b4cd8d160045fc1cedb2a21c 100644 (file)
@@ -38,7 +38,6 @@
 #include <xkbcommon/xkbcommon.h>
 
 
-#define WL_SURFACE_HAS_BUFFER_SCALE 3
 #define WL_POINTER_HAS_FRAME 5
 
 /* the magic mime type we use for local DND operations.
index d3e31a49201c94593d2c233853434361b45be592..0c194247492b49be12253d00953142ef078b1403 100644 (file)
@@ -3771,7 +3771,7 @@ pointer_surface_update_scale (GdkDevice *device)
   guint32 scale;
   GSList *l;
 
-  if (display_wayland->compositor_version < WL_SURFACE_HAS_BUFFER_SCALE)
+  if (display_wayland->compositor_version < WL_SURFACE_SET_BUFFER_SCALE_SINCE_VERSION)
     {
       /* We can't set the scale on this surface */
       return;
index 5d277a8c94abb3d8aa4ee57031bb5f6ae09db9ac..13e81955773f42338be4c428cb11f6b832c329db 100644 (file)
@@ -426,7 +426,7 @@ gdk_wayland_surface_update_scale (GdkSurface *surface)
   guint32 scale;
   GSList *l;
 
-  if (display_wayland->compositor_version < WL_SURFACE_HAS_BUFFER_SCALE)
+  if (display_wayland->compositor_version < WL_SURFACE_SET_BUFFER_SCALE_SINCE_VERSION)
     {
       /* We can't set the scale on this surface */
       return;
@@ -524,7 +524,7 @@ _gdk_wayland_display_create_surface (GdkDisplay     *display,
   g_object_ref (surface);
 
   /* More likely to be right than just assuming 1 */
-  if (display_wayland->compositor_version >= WL_SURFACE_HAS_BUFFER_SCALE)
+  if (display_wayland->compositor_version >= WL_SURFACE_SET_BUFFER_SCALE_SINCE_VERSION)
     {
       GdkMonitor *monitor = g_list_model_get_item (gdk_display_get_monitors (display), 0);
       if (monitor)
@@ -792,7 +792,7 @@ gdk_wayland_surface_sync_buffer_scale (GdkSurface *surface)
 
   /* Only set the buffer scale if supported by the compositor */
   display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
-  if (display->compositor_version >= WL_SURFACE_HAS_BUFFER_SCALE)
+  if (display->compositor_version >= WL_SURFACE_SET_BUFFER_SCALE_SINCE_VERSION)
     wl_surface_set_buffer_scale (impl->display_server.wl_surface, impl->scale);
 
   impl->buffer_scale_dirty = FALSE;