diff --git a/gdk/wayland/gdkscreen-wayland.c b/gdk/wayland/gdkscreen-wayland.c index 862b253451..8144383518 100644 --- a/gdk/wayland/gdkscreen-wayland.c +++ b/gdk/wayland/gdkscreen-wayland.c @@ -805,12 +805,13 @@ _gdk_wayland_screen_new (GdkDisplay *display) screen_wayland->visual = gdk_wayland_visual_new (screen); + init_multihead (screen); + screen_wayland->root_window = _gdk_wayland_screen_create_root_window (screen, - screen_wayland->width, - screen_wayland->height); + screen_wayland->width, + screen_wayland->height); - init_multihead (screen); init_settings (screen); return screen; diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c index f4db8daa30..acb29e3f7f 100644 --- a/gdk/wayland/gdkwindow-wayland.c +++ b/gdk/wayland/gdkwindow-wayland.c @@ -237,6 +237,20 @@ _gdk_wayland_screen_create_root_window (GdkScreen *screen, impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); impl->wrapper = GDK_WINDOW (window); + if (gdk_screen_get_n_monitors(screen) > 0) + impl->scale = gdk_screen_get_monitor_scale_factor (screen, 0); + else + impl->scale = 1; + + /* logical 1x1 fake buffer */ + impl->cairo_surface = + cairo_image_surface_create (CAIRO_FORMAT_ARGB32, + impl->scale, + impl->scale); + +#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE + cairo_surface_set_device_scale (impl->cairo_surface, impl->scale, impl->scale); +#endif window->window_type = GDK_WINDOW_ROOT; window->depth = 32;