GNOME default DPI doesn't match X default DPI

Bug #157398 reported by Emmet Hikory
88
This bug affects 11 people
Affects Status Importance Assigned to Milestone
gnome-control-center
Fix Released
Medium
gnome-control-center (Ubuntu)
Invalid
Wishlist
Unassigned
Declined for Maverick by Sebastien Bacher
gnome-control-center (openSUSE)
Fix Released
Critical

Bug Description

Binary package hint: gnome-control-center

I suspect that the problem doesn't actually lie in gnome-appearance-properties, but as that was the interface for a workaround, it seems a good place for the report. Please reassign as appropriate.

The GNOME default API, as reported by the Appearance control does not match the DPI as reported by xpdyinfo (which, at least for my configuration, is collected from edid information from my screen). As a result, the fonts are sized oddly for the screen, and there is a marked difference in scaling between GTK+ applications and tk or base X applications.

Changing the DPI in the Appearance control (Appearance...Fonts...DPI) to match the value reported by xpdyinfo makes the interface look much crisper.

Ideally this wouldn't be done manually: rather the current session would default to the value reported by X when the session began, and applications would scale appropriately. Users interested in larger / smaller fonts would adjust the font size, without needing to worry about the physical screen specifications.

Emmet Hikory (persia)
Changed in gnome-control-center:
importance: Undecided → Wishlist
Revision history for this message
Jouni Mettala (jouni-mettala) wrote :

xdpyinfo |grep resolution differs from System...Preferences...Appearance...Fonts...Details

Changed in gnome-control-center:
status: New → Confirmed
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for your bug. The dpi are forced to 96 because there is too many configuration where xorg gets the value wrong and creates issues

Changed in gnome-control-center:
assignee: nobody → desktop-bugs
status: Confirmed → Invalid
Revision history for this message
Emmet Hikory (persia) wrote :

While I certainly agree with the reason for the bug, I nonetheless believe it to be a bug. Given that it is rather difficult to fix, and that it will not likely be fixed in Ubuntu, I'm adjusting this from "Invalid" to "Won't Fix", which seems to better match the intent of the statement about the bug resolution.

Changed in gnome-control-center:
status: Invalid → Won't Fix
Revision history for this message
hackel (hackel) wrote :

This is a very critical bug, and "won't fix" is really not acceptable. It seems it's been discussed on the GNOME bugzilla that the default should only revert to 96dpi when the real DPI is not available: that is, either it's not detected at all, or the detected value is nonsensical (e.g. 50 !> dpi !>300). Any time a reasonable DPI is detected, it must be used as a default, otherwise the fonts on the desktop look completely wrong. There are many other bugs tied to this 99145, 279195, 253072, etc. At issue is the fact that when 96 is used as a default dpi, then the default font sizes in GNOME and many other applications are all much too large (see bug #310353).

Please change the status of this bug to "confirmed" as a fix is very desperately needed! My last laptop only ran at 1024x768 and had a DPI of 85, and this is quite common for a 15" screen. My current laptop has a DPI of 147, and my netbook is 134. None are 96! Also, DPIs are only going to continue to increase as the technology improves. The desktop needs to react to a variable DPI, and render all fonts the same physical size regardless of screen size or resolution.

Revision history for this message
Emmet Hikory (persia) wrote :

I have a 0.75" 800x600 display, where dpi is very definitely > 300. Excluding values as nonsensical isn't the right way to do it either. Still, I think "wontfix" is the correct value for this bug: it's not going to be fixed in Ubuntu. If GNOME gets DPI independence, that will happen entirely independently of this bug.

Revision history for this message
hackel (hackel) wrote :

What kind of device do you have? Sounds amazing! In any case, I was only repeating the proposed solution of the GNOME developers. If there is a better solution, such as a user dialogue or something, that would be great. I doubt you'll want to run Ubuntu on a .75" display in any case, as you surely couldn't read anything without a magnifying glass!

I just wanted to point out the following Brainstorm Ideas in support of this change:

161 votes: http://brainstorm.ubuntu.com/idea/7415/
136 votes: http://brainstorm.ubuntu.com/idea/3448/
57 votes: http://brainstorm.ubuntu.com/idea/2921/

Of course there may be some overlap here, but that's over 350 people who support DPI auto-detection. I really think this needs to be re-considered . Even if GNOME doesn't implement it by default, Ubuntu can do so easily with a small patch. I would write it myself if I knew it was going to get applied.

The user should not even be allowed to choose DPI him or herself, other than to correct a failed auto-detection, as it is a physical characteristic of the display. We could then use a new "UI scale" option, but this is a separate issue.

Changed in gnome-control-center:
status: Won't Fix → Confirmed
Changed in gnome-control-center:
status: Unknown → Fix Released
Revision history for this message
soc (simon-ochsenreither) wrote :

I'm currently looking into http://svn.gnome.org/viewvc/gnome-settings-daemon/branches/gnome-2-24/plugins/xsettings/gsd-xsettings-manager.c?view=markup

(search for "get_dpi_from_gconf_or_x_server (GConfClient *client)")

Judging from the code:

Basically Gnome uses the dpi value xorg reports when these values are within a reasonable range, but only if the user hasn't overidden these values in his gconf (e. g. via gnome-appearance-properties).
If the user hasn't specified a dpi value and xorg's value is < 50 or > 500, gnome-settings-daemon will choose 96 dpi.

My steps:

1. Create a new user
2. Check xdpyinfo | grep resolution -> DPI value is RIGHT (and not < 50 or > 500)!
3. Check gnome-appearance-properties -> DPI value is WRONG!
4. Check ~/.gconf/desktop/gnome/font_rendering/%gconf.xml -> DPI is NOT set!

In this scenario gnome-settings-daemon should choose xorg's value but does not.

Changed in gnome-control-center:
status: Confirmed → Triaged
Changed in gnome-control-center:
status: Unknown → Fix Released
Revision history for this message
soc (simon-ochsenreither) wrote :

I found the porblem.

All distributions which provide the file /var/lib/gconf/debian.defaults/%gconf-tree.xml override the detection of the right dpi.

Patch is being made.

Revision history for this message
soc (simon-ochsenreither) wrote :

After talking to seb128 on #ubuntu-desktop, it's now clear that the hardcoding of 96 dpi was due to this bug https://launchpad.net/bugs/118745 many people had during the Gutsy dev time frame.

In my opinion that workaround should be removed again, because
a) hardware detection has improved a lot,
b) Gnome has added code to handle these problems in a more sensible way (which doesn't get used because of that workaround),
c) the workaround is duplicating Code and makes it harder to debug problems and
d) the Gnome fix might work, considering the status of the equivalent Novell bug.

Revision history for this message
Emmet Hikory (persia) wrote :

hackel, The exceedingly high DPI device is a head-mounted display, so yes, while it's an extreme case, I'd probably really run it at a fake DPI. That said, the same glass could be used to make a very detailed watch, but users would want to have full size characters, etc.

soc, Thanks for the extended research on this: I suspect that this bug is a duplicate of bug #118745 (albeit a different facet, against a different package), although with all tasks there either "Invalid" or "Fix Released", it may make sense to use this bug for revisiting the discussion. There's probably some other bugs that also affect things that would be exposed by undoing the existing workarounds though: some widgets are defined in terms of pixels, rather than in terms of size, which causes them to scale poorly for DPI adjustments, but I think it's worth tracking them separately: if using the detected DPI on some hardware doesn't result in the correct settings, the detection of that hardware ought be fixed, rather than trying to pick a standard default setting.

Revision history for this message
soc (simon-ochsenreither) wrote :

The whole situation could be compared to the bash->dash transition.
People were upset about it and complained, but the transition has been made.

Either we do the transition or we wait until 2050 when all displays report nicely to xorg.

What has to be done imo is the following:

- Remove that debian/ubuntu-gnome-specific workaround -> The code from Gnome to handle wrong/missing DPIs will now actually work!
- Remove that single integer DPI box on gnome-appearance-properties->Fonts->Details... people abuse that setting

If people really have to manually correct their DPI now, the following is needed:
- Add 2 DPI boxes to gnome-display-properties, one for the horizontal, one for the vertical DPI. The boxes have to accept floating point values. (Or make a whole new widget ... see mockup)
- The DPI values shouldn't be stored in some Gnome-specific file, so that all toolkits can access it
- There should be a system-wide setting and an user-specific setting (PolicyKit).
- The settings should be display-specific, they could probably be stored as hal/udev rules so that the computer "remembers" if the user has manually corrected the DPI.

Revision history for this message
Emmet Hikory (persia) wrote :

I'd be happy with just removing the workaround, and filing new bugs for anything that doesn't work ideally with the detected DPI, either an application making an incorrect assumption, or a detection failure. Changing the UI to accurately reflect separate horizontal and vertical resolutions is interesting, but I think ultimately separable from the whether the DPI values are honoured or ignored.

Revision history for this message
soc (simon-ochsenreither) wrote :

Looks like this was fixed Jaunty Alpha 4, let's see how that works out...

http://www.ubuntu.com/testing/jaunty/alpha4

Revision history for this message
Sebastien Bacher (seb128) wrote :

the jaunty version doesn't force the dpi value

Changed in gnome-control-center:
status: Triaged → Fix Released
Revision history for this message
hackel (hackel) wrote :

As long as it sets the default, then I would agree this is fixed, since it will force developers to re-scale the fonts on their apps to look right. I see no reason not to let users override it if they want. I just wish it would be moved out of the Appearance/Fonts control, because it should be understood by users as a physical characteristic of the screen, not merely a font "preference".

Revision history for this message
Nicolò Chieffo (yelo3) wrote :

I have a question. My monitor is 1440x900 and the dpi value which gnome uses is 121. With this DPI fonts are really gigantic!
Is this ok for my monitor? Or gnome picked up the wrong value?

Revision history for this message
Sebastien Bacher (seb128) wrote :

Nicolo you might want to open an xorg bug rather than comment on a closed one, gnome didn't pick anything that's the xorg detected value

Revision history for this message
Rotbart van Dainig (rotbart-van-dainig) wrote :

It seems that since Jaunty Beta, this is ignored again and there is a default of 96 DPI (at least for both nv and nvidia) set in gconf for LiveCD and Install.

"gconftool-2 --unset /desktop/gnome/font_rendering/dpi" will remove this default value and subsequently, X-based auto-fontsize works - though in gnome-appearance-properties, it still shows 96, no matter what. IIRC, the latter is not the case in Fedora.

Revision history for this message
Rotbart van Dainig (rotbart-van-dainig) wrote :

It seems broken again on current Jaunty.

Steps to reproduce:

Xorg gets DPI from EDID:
(--) NVIDIA(0): DPI set to (85, 86); computed from "UseEdidDpi" X config
(--) NVIDIA(0): option

Appearances shows 96 DPI. Setting it to 96 keeps the default size, setting it to 86 makes the fonts smaller.

"gconftool-2 --unset /desktop/gnome/font_rendering/dpi" removes the default 96 DPI, the fonts get smaller (same size as manually setting to 86).

After logging out and in, the fonts are back to the default size (96).

Changed in gnome-control-center (Ubuntu):
status: Fix Released → Incomplete
Revision history for this message
Rotbart van Dainig (rotbart-van-dainig) wrote :
Changed in gnome-control-center (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
hackel (hackel) wrote :

I hope you will revert this change as soon as possible for Jaunty+1 in order to give developers plenty of time to make sure their apps render properly at native DPIs. It's really disappointing that this fix will not make it into Jaunty because of this.

Revision history for this message
Mikael Nilsson (mini) wrote :

Confirming on lucid, I have the same issue as comment #19

My issue is the following: I switch several times per day between a laptop (131 dpi) and external monitor (92 dpi), and I want GNOME to recognize the switch, keeping the physical font size. Doing

gconftool-2 --unset /desktop/gnome/font_rendering/dpi

after every login achieves what I want - it adjusts the dpi to what my current screen actually has so that fonts have the same physical size.

What code, what service, is responsible for resetting that value *every* time i login, so that I need to unset it again? Does anyone know so I can hack around it or add a bug report?

I *can* manually add the above line to my startup programs, I'll test that...

Changed in gnome-control-center (Ubuntu):
assignee: Ubuntu Desktop Bugs (desktop-bugs) → nobody
Changed in gnome-control-center:
importance: Unknown → Medium
Revision history for this message
Sebastien Bacher (seb128) wrote :

upstream disagree on it being a bug in GNOME

Changed in gnome-control-center (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
hackel (hackel) wrote :

I don't know if it's a bug in GNOME but it's still a bug in Ubuntu! I just installed 12.04 nightly and I cannot find ANY way to fix the DPI. It's currently set to 96 instead of 110 on my test machine, and apparently there is no option anywhere to fix it, in spite of it being correctly detected (as indicated in my Xorg.0.log file). Do I need to start a new bug report for this?

Changed in gnome-control-center (openSUSE):
importance: Unknown → Critical
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.