wayland: Check correct interface

buffer scale is a surface property, so check the version of the surface
interface, not the compositor one.
This commit is contained in:
Benjamin Otte
2023-04-01 01:39:47 +02:00
parent c7499a33fd
commit ae2c28af89
2 changed files with 4 additions and 5 deletions

View File

@@ -3771,7 +3771,7 @@ pointer_surface_update_scale (GdkDevice *device)
guint32 scale;
GSList *l;
if (wl_compositor_get_version (display_wayland->compositor) < WL_SURFACE_SET_BUFFER_SCALE_SINCE_VERSION)
if (wl_surface_get_version (pointer->pointer_surface) < WL_SURFACE_SET_BUFFER_SCALE_SINCE_VERSION)
{
/* We can't set the scale on this surface */
return;

View File

@@ -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;