summaryrefslogtreecommitdiff
path: root/gdk/wayland/gdksurface-wayland.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2023-04-01 01:39:47 +0200
committerBenjamin Otte <otte@redhat.com>2023-04-01 02:22:21 +0200
commitae2c28af89376f69438100f1409042ec78d0ebc2 (patch)
tree1a131e2a32f47a3a5b1f91293269cf836d7444f8 /gdk/wayland/gdksurface-wayland.c
parentc7499a33fd07425b635d54105220267f1e4f2224 (diff)
downloadgtk+-ae2c28af89376f69438100f1409042ec78d0ebc2.tar.gz
wayland: Check correct interface
buffer scale is a surface property, so check the version of the surface interface, not the compositor one.
Diffstat (limited to 'gdk/wayland/gdksurface-wayland.c')
-rw-r--r--gdk/wayland/gdksurface-wayland.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c
index 9374685dbd..38d3cb54e0 100644
--- a/gdk/wayland/gdksurface-wayland.c
+++ b/gdk/wayland/gdksurface-wayland.c
@@ -426,7 +426,8 @@ gdk_wayland_surface_update_scale (GdkSurface *surface)
guint32 scale;
GSList *l;
- if (wl_compositor_get_version (display_wayland->compositor) < WL_SURFACE_SET_BUFFER_SCALE_SINCE_VERSION)
+ if (!impl->display_server.wl_surface ||
+ wl_surface_get_version (impl->display_server.wl_surface) < WL_SURFACE_SET_BUFFER_SCALE_SINCE_VERSION)
{
/* We can't set the scale on this surface */
return;
@@ -782,7 +783,6 @@ static void
gdk_wayland_surface_sync_buffer_scale (GdkSurface *surface)
{
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
- GdkWaylandDisplay *display;
if (!impl->display_server.wl_surface)
return;
@@ -791,8 +791,7 @@ gdk_wayland_surface_sync_buffer_scale (GdkSurface *surface)
return;
/* Only set the buffer scale if supported by the compositor */
- display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
- if (wl_compositor_get_version (display->compositor) >= WL_SURFACE_SET_BUFFER_SCALE_SINCE_VERSION)
+ if (wl_surface_get_version (impl->display_server.wl_surface) >= WL_SURFACE_SET_BUFFER_SCALE_SINCE_VERSION)
wl_surface_set_buffer_scale (impl->display_server.wl_surface, impl->scale);
impl->buffer_scale_dirty = FALSE;