Bug 1022830 - GTK3 apps not honoring system-wide DPI settings nor KDE mouse cursor
Summary: GTK3 apps not honoring system-wide DPI settings nor KDE mouse cursor
Status: RESOLVED FIXED
Alias: None
Product: openSUSE Distribution
Classification: openSUSE
Component: GNOME (show other bugs)
Version: Leap 42.3
Hardware: x86-64 Other
: P2 - High : Major with 11 votes (vote)
Target Milestone: ---
Assignee: E-mail List
QA Contact: E-mail List
URL: https://bugs.kde.org/show_bug.cgi?id=...
Whiteboard: gtk3, Plasma, KDE3, TDE, regression
Keywords: accessibility, Usability
Depends on:
Blocks: 977710
  Show dependency treegraph
 
Reported: 2017-01-31 14:35 UTC by Guillaume Lang
Modified: 2018-04-01 22:44 UTC (History)
19 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
108 DPI Plasma screenshot comparing browsers complying or not with configured UI fonts (495.05 KB, image/png)
2017-02-09 07:33 UTC, Felix Miata
Details
132 DPI screenshot openSUSE 42.2/Plasma 5 with Firefox ESR45 and 52 windows (651.57 KB, image/png)
2017-03-21 23:28 UTC, Felix Miata
Details
cursor theme changes when mouse cursor enter firefox window (200.13 KB, video/webm)
2017-07-07 11:20 UTC, Forgotten User j7NKfSdKw6
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Guillaume Lang 2017-01-31 14:35:14 UTC
After updating (updates spanning roughly the 20170127-20170131 time period, including an update to Firefox), Firefox no longer honors the system-wide DPI settings, nor does it use the KDE cursor.

The DPI settings have been set in '/etc/sddm.conf':
[XDisplay]
...
ServerArguments=-dpi 192
...

The KDE mouse cursor has been set using the KDE settings.

It seems no other application is having issues (tested: KDE, Inkscape, Gimp).

Creating a new user with new .mozilla/GTK/... config files does not solve the issue.
Comment 1 Wolfgang Rosenauer 2017-01-31 18:40:47 UTC
Here are some references to the DPI situation:
https://bugzilla.gnome.org/show_bug.cgi?id=757142
https://bugzilla.mozilla.org/show_bug.cgi?id=1269274

From what I read it seems to be a Gtk(3) decision to ignore X dpi settings?

I have to say that I have a hard time finding out the correct place to fix.

To compare with other Gtk3 based applications probably use evince (because I know offhand that this is Gtk3 (while for example I think gimp is not yet).
Please compare the font sizes and mouse cursors.
Comment 2 Guillaume Lang 2017-02-01 00:21:55 UTC
(In reply to Wolfgang Rosenauer from comment #1)
[..]
> From what I read it seems to be a Gtk(3) decision to ignore X dpi settings?
[..]
> To compare with other Gtk3 based applications probably use evince (because I
> know offhand that this is Gtk3 (while for example I think gimp is not yet).
> Please compare the font sizes and mouse cursors.

Indeed, this appears GTK-related: Evince uses a tiny font size, consistent with that used by Firefox.

However:
- Cursor inside the window:
  Evince = KDE cursor as long as no specific area (such as frame resizing) imposes a change in cursor.
  Firefox = not KDE
- Cursor on a window corner:
  Evince = not KDE
  Firefox = KDE cursor
- Main window title bar:
  Evince = tiny (height, window title, icons)
  Firefox = normal
  Strangely enough, Evince's 'About' window has a title bar of normal size.


PARTIAL WORK-AROUND
In '~/.Xresources':
Xft.dpi:    192

=> font size: ok for Firefox and Evince.
=> Evince title bar: normal height, normal window title, but still tiny icons including the minimize/maximize/close icons.
=> no changes for the cursor situation (unsurprisingly).
Comment 3 Wolfgang Rosenauer 2017-02-06 20:10:38 UTC
Guillaume, can you probably please compare your findings with an upstream tarball of the same Firefox version?
I'm really interested what are upstream and what are openSUSE specific issues.
Comment 4 Felix Miata 2017-02-09 07:33:24 UTC
Created attachment 713485 [details]
108 DPI Plasma screenshot comparing browsers complying or not with configured UI fonts

In screenshot, top browser is Mozilla.org's SeaMonkey 2.47a1, next down openSUSE's Firefox 51.0.1, next 
down Mozilla.org's Firefox ESR 45.7, bottom, Konq. ESR (built with GTK2) and Konq obey UI font settings. GTK3 builds do not. Problem escalates rapidly as DE's logical DPI is increased, and applies to 42.2 as well unless before upgrading from 42.1 libgtk-3-0 is first locked down to 42.1's 3.16.7 or installing 42.1's libgtk-3-0 in 42.2. Regression is the same in KDE3 and TDE.

Another upstream bug:
https://bugs.kde.org/show_bug.cgi?id=367499 open
usability regression: GTK+>3.16.x results in too small GTK3 app UI fonts when logical DPI>96

Why not apply the libgtk-3-0 patch in the Gnome bug? There doesn't seem to be any need for the patch that created the problem in the first place. As I've seen this on Debian and Fedora too, and per the comments in the mozilla.org bug, this is obviously not an exclusively openSUSE bug, but that shouldn't stop openSUSE users from having the regression addressed.
Comment 5 Felix Miata 2017-02-09 08:12:01 UTC
(In reply to Guillaume Lang from comment #2)
> PARTIAL WORK-AROUND
> In '~/.Xresources':
> Xft.dpi:    192
 
The problem exists because libgtk >3.16 forces Xft.dpi to 96 if null, because of the commit referred to in both comment 1 bugs. KDE's "Force fonts DPI:" in systemsettings does the forcing by setting Xft.dpi, so there is a workaround that doesn't require changing .Xresources, but either workaround must be manually updated and session restarted with every display change instead of having the server's DPI automatically used. KDE3 and TDE also force DPI by setting Xft.dpi non-null.

Mouse pointer here gets larger over GTK3 Mozillas than it is over other windows.
Comment 6 Felix Miata 2017-03-21 06:55:58 UTC
This regression is about to hit 42.1 users who will be pushed to 42.2 as 42.1 support expires in coming weeks.

The expedient fix for Leap users of KDE, KDE3, TDE, and possibly other DEs, is probably reverting GTK 3.20 in 42.2 to 42.1's GTK 3.16. I've done so in all my 42.2 installations that had been fresh installations without any apparent ill effects. On my 42.2 installations that were upgrades from 42.1, I set zypper locks libgtk-3*, gtk3-dat*, gtk3-lan*, gtk3-too* before upgrading to produce the same effect.

Longer term it seems like one solution would be something that on X session startup discovers its DPI, then sets the previously optional Xft.dpi xrdb variable to that value.
Comment 7 Felix Miata 2017-03-21 07:09:18 UTC
(In reply to Felix Miata from comment #6)
> Longer term it seems like one solution would be something that on X session
> startup discovers its DPI, then sets the previously optional Xft.dpi xrdb
> variable to that value.

I had forgotten I already asked for this upstream:
https://bugs.freedesktop.org/show_bug.cgi?id=98909
Comment 8 Wolfgang Rosenauer 2017-03-21 07:41:40 UTC
Please note that this does affect Leap 42.2 right now.
There is currently no plan to switch to Gtk3 for 42.2 but most likely for 42.3 while Tumbleweed already is on Gtk3.

In addition I do not see that Firefox is the correct place to change anything. As I understood the upstream bugreport Firefox is behaving as other Gtk3 applications.
So this is either X or Gnome component?
Comment 9 Felix Miata 2017-03-21 23:28:36 UTC
Created attachment 718250 [details]
132 DPI screenshot openSUSE 42.2/Plasma 5 with Firefox ESR45 and 52 windows

(In reply to Wolfgang Rosenauer from comment #8)
> Please note that this does affect Leap 42.2 right now.

http://fm.no-ip.com/Auth/dpi-screen-window.html is URI used in screenshot's browser windows.

This screenshot shows that 42.2 can be heavily affected by not having Xft.dpi explicitly set to match Xorg's display density. At upper right, Firefox ESR45 built with GTK2 is using the same size 10 UI fonts as apps not built with GTK3. Below ESR45 are 52.0.1 and SeaMonkey 2.52a1 built with GTK3, which are using 42.2-standard GTK 3.20.10-3.1, and displaying vastly undersized UI fonts. The latter appear to be size 7.27pt, or the UI specified size 10pt times 96 divided by 132, the result of GTK 3 needlessly forcing Xft.dpi to 96 in a 132 DPI environment where xrdb's Xft.dpi is null.
Comment 10 Felix Miata 2017-06-21 19:16:46 UTC
I've been working around this on all my own Leap installations by using 42.1's GTK3 libs. On a 42.2 installation not my own I found an audio-related theming dependency interfered, and so had to use 42.2's standard GTK3 libs. Mostly because of this bug, my only 24/7 system remains on 42.1.
Comment 11 Felix Miata 2017-06-22 20:45:42 UTC
https://git.gnome.org/browse/gtk+/commit/?id=bdf0820c501437a2150d8ff0d5340246e713f73f
needs to be reverted.

https://features.opensuse.org/322401
  Title: revert GTK3 upstream's HiDPI usability regression (undersized
  Firefox UI fonts)
   
- openSUSE Distribution: New
+ openSUSE Distribution: Rejected by Tomáš Chvátal (scarabeus_iv)
+ reject reason: If you call it everywhere as regression then you should
+ open a bug. Or even create submission in OBS if you have the patch...
Comment 12 Felix Miata 2017-07-01 06:08:58 UTC
upstream Gnome, Mozilla and KDE bugs from previous comments added to URL
Comment 13 Fabian Vogt 2017-07-05 15:24:15 UTC
(In reply to Felix Miata from comment #11)
> https://git.gnome.org/browse/gtk+/commit/
> ?id=bdf0820c501437a2150d8ff0d5340246e713f73f
> needs to be reverted.
> 
> https://features.opensuse.org/322401
>   Title: revert GTK3 upstream's HiDPI usability regression (undersized
>   Firefox UI fonts)
>    
> - openSUSE Distribution: New
> + openSUSE Distribution: Rejected by Tomáš Chvátal (scarabeus_iv)
> + reject reason: If you call it everywhere as regression then you should
> + open a bug. Or even create submission in OBS if you have the patch...

Raising priority, reverting this patch has only a very low chance of breaking anything (only effective in non-96-DPI situations anyway) and should fix DPI of GTK apps on X11.
Especially important because firefox is the default browser in all DEs.
Comment 14 Fabian Vogt 2017-07-06 11:22:37 UTC
I packaged a test package with the partial revert and it seems to work for me.
The DPI settings are now respected by GTK3 applications, while they're not with libgtk-3-0 from 42.3.

Note that firefox in 42.3 is still using GTK 2, so not affected.
I used nemo instead for testing.

Please confirm that it fixes the issue.

> zypper ar http://download.opensuse.org/repositories/home:favogt:branches:openSUSE:Leap:42.3/standard/ hfboSL423
> zypper -v dup --from hfboSL423
Comment 15 Felix Miata 2017-07-06 15:21:58 UTC
On host gx780 with TDE, I did a fresh zypper dup from 13.2 to 42.3 with favogt repo enabled. GTK3 RV54 and RV55 builds from mozilla.org *are* using the same UI text as other apps. IOW, good fix WRT UI fonts.

42.2 and TW do need this (and Firefox is still using scrollbars so narrow they are hard to see or target, ignoring "use my TDE style in GTK3 applications").

WRT cursor I can't recall seeing the problem described in comment 0. Should it not be a separate issue/bug?
Comment 17 Forgotten User j7NKfSdKw6 2017-07-07 11:20:42 UTC
Created attachment 731565 [details]
cursor theme changes when mouse cursor enter firefox window

Found this bug report for a problem I came across in Leap 42.3.
Firefox does not honor the mouse cursor theme in Plasma 5
Comment 18 Fabian Vogt 2017-07-07 11:29:18 UTC
(In reply to P. Otato from comment #17)
> Created attachment 731565 [details]
> cursor theme changes when mouse cursor enter firefox window
> 
> Found this bug report for a problem I came across in Leap 42.3.
> Firefox does not honor the mouse cursor theme in Plasma 5

Can you open a separate but report for this?
I cannot reproduce this on 42.3 here.
Comment 19 Wolfgang Bauer 2017-07-07 11:48:21 UTC
(In reply to Fabian Vogt from comment #18)
> (In reply to P. Otato from comment #17)
> > Created attachment 731565 [details]
> > cursor theme changes when mouse cursor enter firefox window
> > 
> > Found this bug report for a problem I came across in Leap 42.3.
> > Firefox does not honor the mouse cursor theme in Plasma 5
> 
> Can you open a separate but report for this?
> I cannot reproduce this on 42.3 here.

Try to set the cursor theme in the GTK settings.
Comment 20 Forgotten User j7NKfSdKw6 2017-07-07 12:53:04 UTC
(In reply to Wolfgang Bauer from comment #19)
> (In reply to Fabian Vogt from comment #18)
> > (In reply to P. Otato from comment #17)
> > > Created attachment 731565 [details]
> > > cursor theme changes when mouse cursor enter firefox window
> > > 
> > > Found this bug report for a problem I came across in Leap 42.3.
> > > Firefox does not honor the mouse cursor theme in Plasma 5
> > 
> > Can you open a separate but report for this?
> > I cannot reproduce this on 42.3 here.
> 
> Try to set the cursor theme in the GTK settings.
Setting the cursor theme in the GTK settings solves this problem although this procedure is not necessary in Leap 42.2. Thank you both for the quick response, your help is highly appreciated.
Comment 21 Bernhard Wiedemann 2017-07-13 14:00:22 UTC
This is an autogenerated message for OBS integration:
This bug (1022830) was mentioned in
https://build.opensuse.org/request/show/510082 42.3 / gtk3
Comment 22 Felix Miata 2017-08-09 07:51:50 UTC
Who is supposed to be providing what info? Not forcing Xft.dpi to 96 is fixed by using the comment 14 rpms. The mouse cursor part of comment 0 I can't answer.
Comment 30 Bernhard Wiedemann 2017-09-05 08:01:02 UTC
This is an autogenerated message for OBS integration:
This bug (1022830) was mentioned in
https://build.opensuse.org/request/show/521009 42.3 / gtk3
Comment 31 Christoph Obexer 2017-09-06 06:57:31 UTC
Could this dpi patch from https://build.opensuse.org/request/show/521009 please also reach Tumbleweed please?

Thanks!
Comment 32 Swamp Workflow Management 2017-09-09 16:08:51 UTC
openSUSE-RU-2017:2405-1: An update that has one recommended fix can now be installed.

Category: recommended (low)
Bug References: 1022830
CVE References: 
Sources used:
openSUSE Leap 42.3 (src):    gtk3-3.20.10-9.1
openSUSE Leap 42.2 (src):    gtk3-3.20.10-5.6.1
Comment 33 Swamp Workflow Management 2017-09-28 16:12:16 UTC
SUSE-RU-2017:2592-1: An update that has one recommended fix can now be installed.

Category: recommended (low)
Bug References: 1022830
CVE References: 
Sources used:
SUSE Linux Enterprise Software Development Kit 12-SP3 (src):    gtk3-3.20.10-17.3.20
SUSE Linux Enterprise Software Development Kit 12-SP2 (src):    gtk3-3.20.10-17.3.20
SUSE Linux Enterprise Server for Raspberry Pi 12-SP2 (src):    gtk3-3.20.10-17.3.20
SUSE Linux Enterprise Server 12-SP3 (src):    gtk3-3.20.10-17.3.20
SUSE Linux Enterprise Server 12-SP2 (src):    gtk3-3.20.10-17.3.20
SUSE Linux Enterprise Desktop 12-SP3 (src):    gtk3-3.20.10-17.3.20
SUSE Linux Enterprise Desktop 12-SP2 (src):    gtk3-3.20.10-17.3.20
Comment 34 Bernhard Wiedemann 2017-10-20 16:01:08 UTC
This is an autogenerated message for OBS integration:
This bug (1022830) was mentioned in
https://build.opensuse.org/request/show/535496 Factory / gtk3
Comment 35 Atri Bhattacharya 2018-04-01 22:44:30 UTC
https://build.opensuse.org/request/show/535496 got accepted, implies this is fixed. Please reopen if the issue is still relevant.