Xpra: Ticket #1193: DPI is doubled when specified on the client command line

Since v0.16.0, DPI is being doubled for Windows clients.

v0.15.10-r11424:

$ xpra info | grep dpi
dpi.default=0
dpi.value=96
dpi.x=0
dpi.y=0

v0.17.0-r12474:

$ xpra info | grep dpi
dpi.default=0
dpi.value=192
dpi.x=0
dpi.y=0

Possibly introduced in r10953?



Mon, 02 May 2016 04:56:54 GMT - Antoine Martin: owner, description changed

Are you sure that the DPI is wrong and that you aren't just seeing desktop scaling in action? (#976) I am seeing correct values, that adjust as I scale up or down (either via tray or ctrl shift +, ctrl shift -) Please include distro info, dummy driver / vfb info, client and server screen settings and resolution, etc.


Mon, 02 May 2016 17:18:12 GMT - nathan-renniewaldock:

It's reporting a dpi of 192 and everything is bigger than it should be, scaling is set to none. Server is Ubuntu 16.04, xpra 0.17.0, dummy driver is 0.3.7 with the patches from repo. Clients, Windows 10, tested xpra 0.16.0 and 0.17.0 (3 different systems, resolutions 1280x800, 1366x768, 14490x900), scaling is wrong with them. Xpra 0.15.10 displays as expected with no changes to server. If I remove dpi from my client config (then it uses auto), it's correct, dpi = 48 is also correct, reports 96 and UI is the correct size. My xpra.conf had dpi = 96 as that used to be the default. In ui_client_base.py, the provided dpi (either command line or xpra.conf) is being doubled.

#use command line value supplied, but scale it:
            xdpi = self.cx(self.cy(2.0*self.dpi))
            ydpi = xdpi

Logs: Client:

2016-05-02 18:22:39,680  screen 0: ('1\\WinSta0\\Default', 1280, 800, 338, 211, [('\\\\.\\DISPLAY1', 0, 0, 1280, 800, 287, 180, 0, 0, 1280, 770)], 0, 0, 1280, 770)
2016-05-02 18:22:39,680  desktop size is 1280x800 with 1 screen:
2016-05-02 18:22:39,680   Default (338x211 mm - DPI: 96x96) workarea: 1280x770
2016-05-02 18:22:39,680     DISPLAY1 (287x180 mm - DPI: 113x112)
2016-05-02 18:22:39,680 dpi: 192, xdpi=192, ydpi=192

Server:

2016-05-02 18:22:46,777  client root window size is 1280x800 with 1 display:
2016-05-02 18:22:46,777   Default (338x211 mm - DPI: 96x96) workarea: 1280x770
2016-05-02 18:22:46,777     DISPLAY1 (287x180 mm - DPI: 113x112)
2016-05-02 18:22:46,777 maximum client resolution is 1280x800 (current server resolution is 1280x800)
2016-05-02 18:22:46,777 set_screen_size(1280, 800) xdpi=192, ydpi=192
2016-05-02 18:22:46,777 set_dpi(192, 192)

Mon, 02 May 2016 17:40:06 GMT - Antoine Martin:

Hah, I was missing the fact that you're using the "--dpi=" command line option. You're totally right, the doubling is a mistake (in other places we average xdpy and ydpi, I must have cut&pasted it wrong).

Fixed in r12516. Will be in the next stable update. Feel free to close.


Mon, 02 May 2016 17:43:57 GMT - Antoine Martin: summary changed

(editing ticket title - I don't think this is specific to MS Windows clients at all, this same code is used by all platforms)


Mon, 02 May 2016 18:46:08 GMT - nathan-renniewaldock: status changed; resolution set


Wed, 25 May 2016 07:01:36 GMT - Antoine Martin:

Found another place that needed fixing: r12668.


Tue, 12 Jul 2016 16:52:22 GMT - Antoine Martin: milestone changed

Milestone renamed


Sat, 23 Jan 2021 05:17:31 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/1193