wayland: Use fractional scaling with the Cairo renderer
authorBenjamin Otte <otte@redhat.com>
Sat, 1 Apr 2023 15:25:33 +0000 (17:25 +0200)
committerBenjamin Otte <otte@redhat.com>
Sat, 1 Apr 2023 18:05:06 +0000 (20:05 +0200)
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

index eb54c9ccab312bdca790f587f63dc1455880b1ed..2e4ad16477cf72131a147d64b08a3cde4a4e3f7a 100644 (file)
@@ -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);