summaryrefslogtreecommitdiff
path: root/gdk/x11
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2014-11-03 22:35:11 -0500
committerMatthias Clasen <mclasen@redhat.com>2014-11-03 22:35:11 -0500
commit113e1d1dc004afcb2fc4220a85291f27ece6fb3c (patch)
tree7caa988e9e36406b4f9958a0392d48ea9e542ba6 /gdk/x11
parent824fa0314d76ce29292b0c2f99f91d2dd2c57b0b (diff)
downloadgtk+-113e1d1dc004afcb2fc4220a85291f27ece6fb3c.tar.gz
Make window scale changes work again
Commit afd9709afff151e04b84b91c6d90b7 made us keep impl window cairo surfaces around across changes of window scale. But the window scale setter forgot to update the size and scale of the surface. The effect of this was that toggling the window scale from 1 to 2 in the inspector was not causing the window to draw at twice the size, although the X window was made twice as big, and input was scaled too. Fix this by updating the surface when the window scale changes.
Diffstat (limited to 'gdk/x11')
-rw-r--r--gdk/x11/gdkwindow-x11.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index 1a7281d61d..926ec707f9 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -1899,6 +1899,11 @@ _gdk_x11_window_set_window_scale (GdkWindow *window,
impl = GDK_WINDOW_IMPL_X11 (window->impl);
impl->window_scale = scale;
+#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE
+ if (impl->cairo_surface)
+ cairo_surface_set_device_scale (impl->cairo_surface, impl->window_scale, impl->window_scale);
+#endif
+ _gdk_window_update_size (window);
toplevel = _gdk_x11_window_get_toplevel (window);
if (toplevel && window->window_type != GDK_WINDOW_FOREIGN)