mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 10:50:10 +00:00
wayland: Use proper macro
Wayland has macros to check required versions. Use those instead of custom ones.
This commit is contained in:
parent
ce86ec5599
commit
c97b489316
@ -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.
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user