Xpra: Ticket #887: chrome dpi issue

This has to be the weirdest issue I've encountered. After upgrading google-chrome from 43.0.2357.124-1 to 43.0.2357.125-1, the chrome window forwarded over network through xpra has extremely low dpi. See attached file.

Window forwarded through ssh -X behaves normally. So does local instance of chrome. Downgrading the chrome back to 43.0.2357.124-1 resolve the issue. Something must have changed between chrome *.124 and *.125 that interacts with xpra badly.

I'm running xpra 0.16 in both client(32bit) and server (64bit) on Ubuntu 14.04. Both of the versions are from xpra.org repository. Here's my options for server:

XPRA_CLIPBOARD_LIMIT=20 xpra --xvfb='Xorg -noreset -nolisten tcp +extension GLX +extension RANDR +extension RENDER \
    -logfile ${HOME}/.xpra/Xvfb-10.log  -config ${HOME}/.xpra/xorg.conf' start :100 --bind-tcp=0.0.0.0:10000

Here's my client option:

xpra --encoding=rgb --packet-encoder=rencode --speaker-code=wav --compressor=lz4 attach tcp:workstation:10000

Let me know if more debugging information is needed!



Thu, 11 Jun 2015 19:14:20 GMT - Jiang: attachment set


Fri, 12 Jun 2015 20:02:14 GMT - Jiang: priority changed

Just as an additional notes. No other applications, such as firefox or gimp, has this dpi issue when forwarded over xpra.


Fri, 12 Jun 2015 20:05:52 GMT - Antoine Martin: owner, description changed

FYI:

I have no idea where we can lookup the delta between those two versions of chrome, but it would be very interesting to look at it.

Have you tried xpra's dpi switch? Does it help or make any difference at all?


Fri, 12 Jun 2015 20:11:56 GMT - Jiang:

Can you reproduce this issue on your fedora box? This seems to be the only "key fix" during this chrome update, which looks like it's indeed dpi related: https://code.google.com/p/chromium/issues/detail?id=498426 I've got it from here: http://googlechromereleases.blogspot.com/ Ironically, it is used to "solve" the dpi issue in some linux instances.

I did try --dpi 110 on the server, but it does not seem to help.


Fri, 12 Jun 2015 20:20:10 GMT - Antoine Martin:

Their changes look correct. Using the gtk xft dpi.

Can you post the output of:

xrdb -query -all

and:

python /usr/lib/python2.7/dist-packages/xpra/platform/gui.py

(both from within the xpra session and directly on the client system)


Fri, 12 Jun 2015 20:22:36 GMT - Jiang:

Per the bug report from chrome, I actually found a workaround. I simply append

--high-dpi-support=1 --force-device-scale-factor=1

to my google chrome command line when launching it. That seems to fix the problem. So if you could not fix it, an additional notes in the help page could be added for this workaround.


Fri, 12 Jun 2015 20:25:07 GMT - Jiang:

I can post the outcome of xrdb and xpra python gui. But should I run it on client or server side?


Fri, 12 Jun 2015 20:26:10 GMT - Antoine Martin:

But should I run it on client or server side?


Please include both (client and server) for both of them! (server and client).


Fri, 12 Jun 2015 20:35:25 GMT - Jiang:

On server, I run it on the screen instance that is spawned by DISPLAY=100 screen where display 100 is my xpra instance. This screen instance is where I launch new application to be forwarded.

gnome.Xft/DPI:  98304
Xft.hinting:    1
xterm*pointerShape:     arrow
Xft.antialias:  1
Xft.dpi:        96
*customization: -color
xterm*Background:       black
xterm*pointerColor:     blue
Xft.hintstyle:  hintslight
xterm*cursorColor:      LightBlue
XTerm*metaSendsEscape:  true
xterm*Foreground:       white
Xft.rgba:       rgb

python /usr/lib/python2.7/dist-packages/xpra/platform/gui.py

Using X11 display :100
* antialias.contrast               : 1000
* antialias.enabled                : True
* antialias.hinting                : True
* antialias.hintstyle              : hintslight
* antialias.orientation            : RGB
* desktop_names                    : ['Workspace 1', 'Workspace 2', 'Workspace 3', 'Workspace 4']
* desktops                         : 4
* double_click.distance            : (-1, -1)
* double_click.time                : 543
* dpi                              : 19
* dpi.randr                        : (17, 21)
* dpi.x                            : 17
* dpi.xsettings                    : -1
* dpi.y                            : 21
* fixed_cursor_size                : (-1, -1)
* icon_size                        : 16
* native_notifiers                 : ['DBUS_Notifier_factory', 'PyNotify_Notifier']
* native_system_trays              : []
* native_tray_menu_helpers         : []
* native_trays                     : []
* system_bell                      : system_bell
* vertical-refresh                 : 20
* workarea                         : (0, 0, 1440, 872)
* workareas                        : []
* xsettings.Gdk/UnscaledDPI        : 98304
* xsettings.Gdk/WindowScalingFactor : 1
* xsettings.Gtk/AutoMnemonics      : 1
* xsettings.Gtk/ButtonImages       : 0
* xsettings.Gtk/CanChangeAccels    : 0
* xsettings.Gtk/ColorPalette       : black:white:gray50:red:purple:blue:light blue:green:yellow:orange:lavender:brown:goldenrod4:dodger blue:pink:light green:gray10:gray30:gray75:gray90
* xsettings.Gtk/ColorScheme        :
* xsettings.Gtk/CursorBlinkTimeout : 10
* xsettings.Gtk/CursorThemeName    : DMZ-White
* xsettings.Gtk/CursorThemeSize    : 24
* xsettings.Gtk/EnableAnimations   : 1
* xsettings.Gtk/FontName           : Ubuntu Medium 11
* xsettings.Gtk/IMModule           : gtk-im-context-simple
* xsettings.Gtk/IMPreeditStyle     : callback
* xsettings.Gtk/IMStatusStyle      : callback
* xsettings.Gtk/KeyThemeName       : Default
* xsettings.Gtk/MenuBarAccel       : F10
* xsettings.Gtk/MenuImages         : 0
* xsettings.Gtk/Modules            : canberra-gtk-module
* xsettings.Gtk/RecentFilesEnabled : 1
* xsettings.Gtk/RecentFilesMaxAge  : 4294967295
* xsettings.Gtk/ShellShowsAppMenu  : 0
* xsettings.Gtk/ShellShowsMenubar  : 0
* xsettings.Gtk/ShowInputMethodMenu : 1
* xsettings.Gtk/ShowUnicodeMenu    : 1
* xsettings.Gtk/TimeoutInitial     : 200
* xsettings.Gtk/TimeoutRepeat      : 20
* xsettings.Gtk/ToolbarIconSize    : large
* xsettings.Gtk/ToolbarStyle       : both-horiz
* xsettings.Net/CursorBlink        : 0
* xsettings.Net/CursorBlinkTime    : 1200
* xsettings.Net/DndDragThreshold   : 8
* xsettings.Net/DoubleClickTime    : 543
* xsettings.Net/EnableEventSounds  : 1
* xsettings.Net/EnableInputFeedbackSounds : 0
* xsettings.Net/FallbackIconTheme  : gnome
* xsettings.Net/IconThemeName      : ubuntu-mono-dark
* xsettings.Net/SoundThemeName     : ubuntu
* xsettings.Net/ThemeName          : Adwaita
* xsettings.Xft/Antialias          : 1
* xsettings.Xft/DPI                : 98304
* xsettings.Xft/HintStyle          : hintslight
* xsettings.Xft/Hinting            : 1
* xsettings.Xft/RGBA               : rgb
* xsettings.serial                 : 0

On client:

qian2@MacBookPro:$  xrdb -query -all
*customization: -color
XTerm*metaSendsEscape:  true
Xft.antialias:  1
Xft.dpi:        96
Xft.hinting:    1
Xft.hintstyle:  hintslight
Xft.rgba:       rgb
xterm*Background:       black
xterm*Foreground:       white
xterm*cursorColor:      LightBlue
xterm*pointerColor:     blue
xterm*pointerShape:     arrow
Using X11 display :0.0
* antialias.contrast               : 1000
* antialias.enabled                : True
* antialias.hinting                : True
* antialias.hintstyle              : hintslight
* antialias.orientation            : RGB
* desktop_names                    : ['Workspace 1', 'Workspace 2', 'Workspace 3', 'Workspace 4']
* desktops                         : 4
* double_click.distance            : (-1, -1)
* double_click.time                : 543
* dpi                              : 96
* dpi.randr                        : (96, 96)
* dpi.x                            : 96
* dpi.xsettings                    : -1
* dpi.y                            : 96
* fixed_cursor_size                : (-1, -1)
* icon_size                        : 16
* native_notifiers                 : ['DBUS_Notifier_factory', 'PyNotify_Notifier']
* native_system_trays              : ['AppindicatorTray']
* native_tray_menu_helpers         : []
* native_trays                     : ['AppindicatorTray']
* system_bell                      : system_bell
* vertical-refresh                 : 60
* workarea                         : (0, 0, 1440, 872)
* workareas                        : []
* xsettings.Gdk/UnscaledDPI        : 98304
* xsettings.Gdk/WindowScalingFactor : 1
* xsettings.Gtk/AutoMnemonics      : 1
* xsettings.Gtk/ButtonImages       : 0
* xsettings.Gtk/CanChangeAccels    : 0
* xsettings.Gtk/ColorPalette       : black:white:gray50:red:purple:blue:light blue:green:yellow:orange:lavender:brown:goldenrod4:dodger blue:pink:light green:gray10:gray30:gray75:gray90
* xsettings.Gtk/ColorScheme        :
* xsettings.Gtk/CursorBlinkTimeout : 10
* xsettings.Gtk/CursorThemeName    : DMZ-White
* xsettings.Gtk/CursorThemeSize    : 24
* xsettings.Gtk/EnableAnimations   : 1
* xsettings.Gtk/FontName           : Ubuntu Medium 11
* xsettings.Gtk/IMModule           : gtk-im-context-simple
* xsettings.Gtk/IMPreeditStyle     : callback
* xsettings.Gtk/IMStatusStyle      : callback
* xsettings.Gtk/KeyThemeName       : Default
* xsettings.Gtk/MenuBarAccel       : F10
* xsettings.Gtk/MenuImages         : 0
* xsettings.Gtk/Modules            : canberra-gtk-module
* xsettings.Gtk/RecentFilesEnabled : 1
* xsettings.Gtk/RecentFilesMaxAge  : 4294967295
* xsettings.Gtk/ShellShowsAppMenu  : 0
* xsettings.Gtk/ShellShowsMenubar  : 0
* xsettings.Gtk/ShowInputMethodMenu : 1
* xsettings.Gtk/ShowUnicodeMenu    : 1
* xsettings.Gtk/TimeoutInitial     : 200
* xsettings.Gtk/TimeoutRepeat      : 20
* xsettings.Gtk/ToolbarIconSize    : large
* xsettings.Gtk/ToolbarStyle       : both-horiz
* xsettings.Net/CursorBlink        : 0
* xsettings.Net/CursorBlinkTime    : 1200
* xsettings.Net/DndDragThreshold   : 8
* xsettings.Net/DoubleClickTime    : 543
* xsettings.Net/EnableEventSounds  : 1
* xsettings.Net/EnableInputFeedbackSounds : 0
* xsettings.Net/FallbackIconTheme  : gnome
* xsettings.Net/IconThemeName      : ubuntu-mono-dark
* xsettings.Net/SoundThemeName     : ubuntu
* xsettings.Net/ThemeName          : Adwaita
* xsettings.Xft/Antialias          : 1
* xsettings.Xft/DPI                : 98304
* xsettings.Xft/HintStyle          : hintslight
* xsettings.Xft/Hinting            : 1
* xsettings.Xft/RGBA               : rgb
* xsettings.serial                 : 0

Fri, 12 Jun 2015 20:53:55 GMT - Antoine Martin:

So the dpi properties are all set correctly and match the client side values:

Xft.dpi:        96
gnome.Xft/DPI:  98304
xsettings.Gdk/UnscaledDPI        : 98304
xsettings.Xft/DPI                : 98304

(all but Xft.dpi are multiplied by 1024)

The only values that are NOT quite right are:

* dpi                              : 19
* dpi.randr                        : (17, 21)
* dpi.x                            : 17
* dpi.xsettings                    : -1
* dpi.y                            : 21

That's because we do not ship a modified dummy driver for Ubuntu, and so the dummy screen has a fixed size, which ends up being far too big for your screen resolution. (and therefore giving very low DPI values)

I suspect that somehow Chrome is calculating the DPI values directly from the dimensions given by the X11 server, rather than honouring the properties (as it should - and as the commits seem to imply).

Without fixing the chrome code, you can workaround this problem from the xpra side in a number of ways:

Both options will also fix many applications, not just chrome (Java and others). The second option is much easier, but it is only reliable if the client has a fixed screen size (or within similar ranges).


Fri, 12 Jun 2015 20:59:47 GMT - Jiang: status changed; resolution set

I'll stick to the current workaround (by appending an additional option to chrome) until I encounter some other program that has this problem. I can now close this ticket.


Fri, 13 Nov 2015 05:47:13 GMT - Antoine Martin:

Note: we now have a wiki page for DPI issues: wiki/DPI


Sat, 23 Jan 2021 05:08:52 GMT - migration script:

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