Make Wine to automatically recognize desktop DPI

Bug #1575707 reported by Alberto Salvia Novella
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Wine
Confirmed
Medium
wine1.6 (Ubuntu)
Triaged
Wishlist
Unassigned

Bug Description

Please make Wine to automatically recognize the desktop DPI and set a good default for its config.

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: wine 1:1.6.2-0ubuntu14
ProcVersionSignature: Ubuntu 4.4.0-21.37-generic 4.4.6
Uname: Linux 4.4.0-21-generic x86_64
ApportVersion: 2.20.1-0ubuntu2
Architecture: amd64
CurrentDesktop: Unity
Date: Wed Apr 27 16:31:24 2016
InstallationDate: Installed on 2016-04-26 (0 days ago)
InstallationMedia: Ubuntu 16.04 LTS "Xenial Xerus" - Release amd64 (20160420.1)
SourcePackage: wine1.6
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
In , Gpwyn5s02 (gpwyn5s02) wrote :

It does not seem that the X11 driver is correctly setting the DPI of the display
it is using, and defaults it to 72 DPI. This sucks mightily on my 1600x1200 19"
monitor, as it makes all the scaled fonts too small to read.

If I manually create the HKLM/[System\\CurrentControlSet\\Hardware
Profiles\\Current\\Software\\Fonts\\LoxPixels entry, and set it to 160, then
most of the fonts (all save the menu bar fonts) are scaled a bit more reasonably.

Revision history for this message
In , Vitaliy-bugzilla (vitaliy-bugzilla) wrote :

Confirming. There is more. Some dialogs' content is scaled and some is not. When
it's scaled it looks like everything inside the window is scaled, but the window
size is too small.

Revision history for this message
In , Gpwyn5s02 (gpwyn5s02) wrote :

It also seems that Wine is not taking into account the DPI when computing the
font to use for System fonts.

Revision history for this message
In , Wijn-t (wijn-t) wrote :

FYI:

- wine uses a default of 96 dpi
- it does not use the settings from 'X'. Wine did do so some time ago, but
there are far too many broken user configurations around.
- 1600 dots on a 19 inch display is theoretically 105 dpi. On a LCD panel
that should be correct, if you are using a CRT monitor the value may be 120.
- setting the LogPixels value is not the whole story. The fonts that you are
laking about are stored HKCU\Control Panel\Desktop\WindowMetrics. Font sizes
are device units: pixels. That means those fonts will not be affected by
setting a different dpi, but the actual fontsizes must be adjusted. That is
what happens on Windows when you change the dpi in the Display Properties
applet.
- Wine does not have that yet. For the moment you can try the Display
Properties applet fom win98. "control /path/to/desk.cpl" works here enough
to modify those font settings.

Rein.

Revision history for this message
In , Gpwyn5s02 (gpwyn5s02) wrote :

"Display
Properties applet fom win98. "control /path/to/desk.cpl" works here enough
to modify those font settings. "

Not for me. Nothing is being created in the registry when I make these changes.

This still does not invalidate the meat of this bug - that the font choices Wine
is making are unusable in many cases.

Revision history for this message
In , Wijn-t (wijn-t) wrote :

> Not for me. Nothing is being created in the registry when I make these changes.

Sorry, I had some changes in my tree that where not committed yet. If you update
now, it should work better.

> This still does not invalidate the meat of this bug - that the font choices
> Wine is making are unusable in many cases.

Ah, the meat of this bug report is then a duplication of a few others.

Rein.

Revision history for this message
In , Austin English (austinenglish) wrote :

Is this still a problem in current (0.9.52 or newer) wine?

Revision history for this message
In , Gpwyn5s02 (gpwyn5s02) wrote :

It seems to still be a problem.

Revision history for this message
In , Austin English (austinenglish) wrote :

Default is now 96, max is 480. Fixed?

Revision history for this message
In , Gpwyn5s02 (gpwyn5s02) wrote :

I still have my doubts the DPI as reported by X is being used correctly, as the fonts are REALLY TINY.

However, by going into winecfg and increasing the font size there, I was able to get usable sized fonts - but not by default.

Revision history for this message
In , Austin English (austinenglish) wrote :

(In reply to comment #9)
> I still have my doubts the DPI as reported by X is being used correctly, as the
> fonts are REALLY TINY.
>
> However, by going into winecfg and increasing the font size there, I was able
> to get usable sized fonts - but not by default.
>

Yes, but wine has many different environments and configurations to account for. While that resolution works well for you, setting it to high on a small screen will make it completely unusable. Setting it low on the other hand is an annoyance, but doesn't break things and is easily fixed.

Revision history for this message
In , Austin English (austinenglish) wrote :

Still present in git (I'm assuming this bug is about reading the DPI from X and using that for the default in Wine).

Revision history for this message
In , Austin English (austinenglish) wrote :

Please retest in current git. If still present, update version field to earliest known version of wine that had this bug. Thanks!

Revision history for this message
In , Gpwyn5s02 (gpwyn5s02) wrote :

I've tested this with wine-1.1.12-420-gae48e09.

Steps to reproduce.

1) Via Regedit, unset HKLM/[System\\CurrentControlSet\\Hardware
Profiles\\Current\\Software\\Fonts\\LoxPixels
2) set display DPI to 96 via "xrandr --dpi 96"
3) Run regedit, observe font sizes.
4) exit regedit
5) set display DPI to 200 via "xrandr --dpi 200"
6) Run regedit, observe font sizes.

Expected result: Font sized should change.
Actual results: Font sizes unchanged.

I am pulling the latest GIT now, and will report when that build is done.

Revision history for this message
In , Dan Kegel (dank) wrote :

Which native Linux apps obey that setting?

Nothing is changed in git, I suspect.

Revision history for this message
In , Gpwyn5s02 (gpwyn5s02) wrote :

I know Google Earth is very much affected by it, and so is Firefox (after a restart).

Revision history for this message
In , Detlef (winspool) wrote :

Before wine get and use the dpi value from X,
rendering with different dpi values should work without regressions.

The requirements to verify the correct rendering are the tests.
The tests must be fixed first: http://bugs.winehq.org/show_bug.cgi?id=16060

--
By by ... Detlef

Revision history for this message
In , Jsmith-x (jsmith-x) wrote :

Depends on still open bug 16060

Revision history for this message
In , Austin English (austinenglish) wrote :

Still blocked.

Revision history for this message
Alberto Salvia Novella (es20490446e) wrote :
Changed in wine1.6 (Ubuntu):
importance: Undecided → Wishlist
Revision history for this message
In , Alberto Salvia Novella (es20490446e) wrote :

Please make Wine to automatically recognize the desktop DPI and set a good default for its config.

Changed in wine1.6 (Ubuntu):
status: New → Triaged
Changed in wine:
importance: Unknown → Wishlist
status: Unknown → New
Revision history for this message
In , Alberto Salvia Novella (es20490446e) wrote :

This bug is also reported to (https://bugs.launchpad.net/wine/+bug/1575707).

Changed in wine:
importance: Wishlist → Unknown
status: New → Unknown
Changed in wine:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
In , Dimesio (dimesio) wrote :

*** Bug 40545 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Winetest (winetest) wrote :

This patch that got merged is closely related.

https://source.winehq.org/patches/data/133251

I quess it could be easily extented to fix this bug.

Revision history for this message
In , Bloodyiron-y (bloodyiron-y) wrote :

DPI issues are persisting, and this also is present in Wayland.

Latest example for me is Ubuntu 22.04 on a Microsoft Surface Pro 9, which runs a display of 2880x1920 (3:2) and I believe it was a regular DPI of 271, up from the normal 96. But in testing 192 seems to be a good number-ish.

In my case installing Mono the install dialogue is so small it's next to impossible to read.

Revision history for this message
In , Alberto Salvia Novella (es20490446e) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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