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.

https://bugzilla.gnome.org/show_bug.cgi?id=733076
This commit is contained in:
Owen W. Taylor
2014-07-11 16:42:38 -04:00
committed by Matthias Clasen
parent cef6f34fb7
commit fc6e2cc4b2
7 changed files with 105 additions and 18 deletions

View File

@ -75,8 +75,8 @@ gdk_quartz_screen_init (GdkQuartzScreen *quartz_screen)
NSScreen *nsscreen;
nsscreen = [[NSScreen screens] objectAtIndex:0];
gdk_screen_set_resolution (screen,
72.0 * [nsscreen userSpaceScaleFactor]);
_gdk_screen_set_resolution (screen,
72.0 * [nsscreen userSpaceScaleFactor]);
gdk_quartz_screen_calculate_layout (quartz_screen);