From 6d4d9af14e729682cef1506fd785de08a23dfa19 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sat, 1 Apr 2023 17:25:33 +0200 Subject: [PATCH] wayland: Use fractional scaling with the Cairo renderer Cairo can do that, so just enable it: * Create surfaces with the correct fractionally scaled size. * Set the Cairo surface's device scale to that number. --- gdk/wayland/gdkcairocontext-wayland.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gdk/wayland/gdkcairocontext-wayland.c b/gdk/wayland/gdkcairocontext-wayland.c index eb54c9ccab..2e4ad16477 100644 --- a/gdk/wayland/gdkcairocontext-wayland.c +++ b/gdk/wayland/gdkcairocontext-wayland.c @@ -21,6 +21,7 @@ #include "gdkcairocontext-wayland.h" #include "gdkprivate-wayland.h" +#include "gdksurface-wayland-private.h" #include "gdkprofilerprivate.h" @@ -130,7 +131,7 @@ gdk_wayland_cairo_context_create_surface (GdkWaylandCairoContext *self) height = gdk_surface_get_height (surface); cairo_surface = gdk_wayland_display_create_shm_surface (display_wayland, width, height, - &GDK_FRACTIONAL_SCALE_INIT_INT (gdk_surface_get_scale_factor (surface))); + &GDK_WAYLAND_SURFACE (surface)->scale); buffer = _gdk_wayland_shm_surface_get_wl_buffer (cairo_surface); wl_buffer_add_listener (buffer, &buffer_listener, cairo_surface); gdk_wayland_cairo_context_add_surface (self, cairo_surface);