forked from AuroraMiddleware/gtk
wayland: Create a cairo surface for the root window
Many parts of GTK+ assume that all windows have a cairo surface assoicated with them. This change provides a logically 1x1 cairo surface (respecting scale) for the root window. https://bugzilla.gnome.org/show_bug.cgi?id=704554
This commit is contained in:
parent
977c6cf4c7
commit
16e43733b9
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user