diff options
author | Benjamin Otte <otte@redhat.com> | 2023-04-01 01:28:46 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2023-04-01 02:22:21 +0200 |
commit | c7499a33fd07425b635d54105220267f1e4f2224 (patch) | |
tree | cb20700ba1cb76d5c3ded34fddf325a321fb2fbd /gdk/wayland/gdksurface-wayland.c | |
parent | c97b4893163a734655ef4b11eb99308718ba769c (diff) | |
download | gtk+-c7499a33fd07425b635d54105220267f1e4f2224.tar.gz |
wayland: Use wl_compositor_get_version()
Wayland has functions to check versions, so use those.
Diffstat (limited to 'gdk/wayland/gdksurface-wayland.c')
-rw-r--r-- | gdk/wayland/gdksurface-wayland.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c index 13e8195577..9374685dbd 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_SET_BUFFER_SCALE_SINCE_VERSION) + if (wl_compositor_get_version (display_wayland->compositor) < 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_SET_BUFFER_SCALE_SINCE_VERSION) + if (wl_compositor_get_version (display_wayland->compositor) >= 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_SET_BUFFER_SCALE_SINCE_VERSION) + if (wl_compositor_get_version (display->compositor) >= WL_SURFACE_SET_BUFFER_SCALE_SINCE_VERSION) wl_surface_set_buffer_scale (impl->display_server.wl_surface, impl->scale); impl->buffer_scale_dirty = FALSE; |