After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 733076 - Handle resolution changes in the GDK backend code
Handle resolution changes in the GDK backend code
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: X11
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-07-11 21:14 UTC by Owen Taylor
Modified: 2014-07-13 20:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Handle resolution changes in the GDK backend code (7.68 KB, patch)
2014-07-11 21:14 UTC, Owen Taylor
accepted-commit_now Details | Review

Description Owen Taylor 2014-07-11 21:14:19 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.)
Comment 1 Owen Taylor 2014-07-11 21:14:22 UTC
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.
Comment 2 Matthias Clasen 2014-07-12 01:56:03 UTC
Review of attachment 280533 [details] [review]:

Looks fine to me, and works in my testing.