GNOME Bugzilla – Bug 733076
Handle resolution changes in the GDK backend code
Last modified: 2014-07-13 20:10:17 UTC
The particular problem being solved here is that when Mutter starts up on a Hi-DPI display, it first sees a DPI of 96, and positions windows and sizes the frame based on that. When the main loop runs, it then resizes windows for larger 192-dpi titlebars. (GNOME Shell disables hi-dpi and sets the window scale to 1 for both Clutter and GTK+ since it is working with X directly.)
Created attachment 280533 [details] [review] Handle resolution changes in the GDK backend code gdk_x11_display_set_window_scale() affects the interpretation of the Xft/DPI XSETTING - it is substituted inside GDK with the value of Gdk/UnscaledDPI xsetting. However, this change is not propagated to GTK+ and from GTK+ back to gdk_screen_set_resolution() until the main loop is run. Fix this by handling the screen resolution directly in gdk/x11. This requires duplication of code between GDK and GTK+ since we still have to handle DPI in GTK+ in the case that GdkSettings:gtk-xft-dpi is set by the application.
Review of attachment 280533 [details] [review]: Looks fine to me, and works in my testing.