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 744354 - server-side decorations render incorrectly in hi-dpi
server-side decorations render incorrectly in hi-dpi
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
3.15.x
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
touch
: 705411 744925 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-02-11 21:23 UTC by Bastian Ilsø
Modified: 2015-03-19 01:00 UTC
See Also:
GNOME target: 3.16
GNOME version: ---


Attachments
picture of incorrect DPI used for server-side decoration on gnome-terminal (313.85 KB, image/jpeg)
2015-02-11 21:23 UTC, Bastian Ilsø
  Details
theme: Scale window decorations on HiDPI displays (13.33 KB, patch)
2015-03-14 21:33 UTC, Florian Müllner
none Details | Review
screenshot with patch (80.52 KB, image/png)
2015-03-14 21:44 UTC, Cosimo Cecchi
  Details
theme: Scale window decorations on HiDPI displays (13.83 KB, patch)
2015-03-14 23:47 UTC, Florian Müllner
committed Details | Review

Description Bastian Ilsø 2015-02-11 21:23:14 UTC
Created attachment 296638 [details]
picture of incorrect DPI used for server-side decoration on gnome-terminal

Today I updated to latest rawhide on a Pixel and noticed that the server-side decorations on gnome-terminal and firefox was rendering at 96DPI. Attached image shows a comparison of nautilus (render correctly) and gnome-terminal (very small x icon).
Comment 1 Bastian Ilsø 2015-02-11 21:24:33 UTC
(was told this was might be a problem in mutter.)
Comment 2 Florian Müllner 2015-02-11 21:30:15 UTC
(In reply to Bastian from comment #1)
> (was told this was might be a problem in mutter.)

It is. I have a work-in-progress patch lying around locally, maybe you could test it tomorrow?
(I can do a rawhide build, so you don't have to build anything yourself)
Comment 3 Bastian Ilsø 2015-02-11 21:32:56 UTC
(In reply to Florian Müllner from comment #2)
> It is. I have a work-in-progress patch lying around locally, maybe you could
> test it tomorrow?
> (I can do a rawhide build, so you don't have to build anything yourself)

Sounds good, but I would need to ask you the favor of telling me how to install the rawhide build tomorrow.
Comment 4 Florian Müllner 2015-02-23 20:13:51 UTC
*** Bug 744925 has been marked as a duplicate of this bug. ***
Comment 5 Florian Müllner 2015-03-14 21:33:13 UTC
Created attachment 299415 [details] [review]
theme: Scale window decorations on HiDPI displays

As we opt out of GTK+/Clutter's HiDPI handling, we need to apply the
window scaling factor manually to decorations, both the geometry and
when drawing.
Comment 6 Cosimo Cecchi 2015-03-14 21:44:51 UTC
Created attachment 299416 [details]
screenshot with patch

Florian, I just tested this patch but while it seems to work well for the geometry of the frames, it does not scale the title correctly.
See attached screenshot.
Comment 7 Giovanni Campagna 2015-03-14 21:48:09 UTC
Maybe it is because gnome-shell/mutter still honor the font scaling?
Comment 8 Florian Müllner 2015-03-14 22:28:37 UTC
(In reply to Cosimo Cecchi from comment #6)
> Florian, I just tested this patch but while it seems to work well for the
> geometry of the frames, it does not scale the title correctly.

Yeah, unfortunately I can only test with forced/artificial window-scaling, not on actual HiDPI hardware. Does

diff --git a/src/ui/theme.c b/src/ui/theme.c
index f36554e..f73b428 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -140,8 +140,8 @@ meta_frame_layout_apply_scale (const MetaFrameLayout *layout,
                                PangoFontDescription  *font_desc)
 {
   int size = pango_font_description_get_size (font_desc);
-  pango_font_description_set_size (font_desc,
-                                   MAX (size * layout->title_scale, 1));
+  double scale = layout->title_scale / meta_theme_get_window_scaling_factor ();
+  pango_font_description_set_size (font_desc, MAX (size * scale, 1));
 }
 
 static MetaButtonSpace*

work?
Comment 9 Cosimo Cecchi 2015-03-14 22:51:18 UTC
Yes, that works perfectly! \o/
Comment 10 Florian Müllner 2015-03-14 23:47:35 UTC
Created attachment 299429 [details] [review]
theme: Scale window decorations on HiDPI displays

Squashed bits from comment #8.
Comment 11 Florian Müllner 2015-03-15 08:42:49 UTC
(In reply to Cosimo Cecchi from comment #9)
> Yes, that works perfectly! \o/

Just to make sure, could you test whether the 'titlebar-uses-system-font' option in org.gnome.desktop.wm.preferences makes a difference?
Comment 12 Cosimo Cecchi 2015-03-16 16:16:35 UTC
Doesn't seem to make a difference; but one thing I noticed with your patch is that shadow sizes don't seem scaled up.
Comment 13 Florian Müllner 2015-03-16 16:21:24 UTC
Right, it doesn't touch shadows at all - but then neither did the new decorations, so this shouldn't be different from 3.14 ...
Comment 14 Cosimo Cecchi 2015-03-16 16:23:08 UTC
They're not different from 3.14. I think it's just slightly more noticeable now that they're the only thing that does not match :-)
Still, I'd take this patch any day, as it's a big improvement.
Comment 15 Florian Müllner 2015-03-17 16:10:23 UTC
Attachment 299429 [details] pushed as 57c1078 - theme: Scale window decorations on HiDPI displays
Comment 16 Florian Müllner 2015-03-19 01:00:09 UTC
*** Bug 705411 has been marked as a duplicate of this bug. ***