From: Benjamin Otte Date: Fri, 31 Mar 2023 23:18:38 +0000 (+0200) Subject: wayland: Use proper macro X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~1^2~472^2~8 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c97b4893163a734655ef4b11eb99308718ba769c;p=gtk4.git wayland: Use proper macro Wayland has macros to check required versions. Use those instead of custom ones. --- diff --git a/gdk/wayland/gdkprivate-wayland.h b/gdk/wayland/gdkprivate-wayland.h index e755689887..73b934d371 100644 --- a/gdk/wayland/gdkprivate-wayland.h +++ b/gdk/wayland/gdkprivate-wayland.h @@ -38,7 +38,6 @@ #include -#define WL_SURFACE_HAS_BUFFER_SCALE 3 #define WL_POINTER_HAS_FRAME 5 /* the magic mime type we use for local DND operations. diff --git a/gdk/wayland/gdkseat-wayland.c b/gdk/wayland/gdkseat-wayland.c index d3e31a4920..0c19424749 100644 --- a/gdk/wayland/gdkseat-wayland.c +++ b/gdk/wayland/gdkseat-wayland.c @@ -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; diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c index 5d277a8c94..13e8195577 100644 --- a/gdk/wayland/gdksurface-wayland.c +++ b/gdk/wayland/gdksurface-wayland.c @@ -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;