Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chrome dpi issue #887

Closed
totaam opened this issue Jun 11, 2015 · 17 comments
Closed

chrome dpi issue #887

totaam opened this issue Jun 11, 2015 · 17 comments

Comments

@totaam
Copy link
Collaborator

totaam commented Jun 11, 2015

Issue migrated from trac ticket # 887

component: core | priority: critical | resolution: fixed

2015-06-11 20:12:58: jiang.qian created the 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!

@totaam
Copy link
Collaborator Author

totaam commented Jun 11, 2015

2015-06-11 20:14:21: jiang.qian uploaded file chrome-screen-shot.png (197.2 KiB)

chrome-screen-shot.png

@totaam
Copy link
Collaborator Author

totaam commented Jun 12, 2015

2015-06-12 21:02:14: jiang.qian changed priority from major to critical

@totaam
Copy link
Collaborator Author

totaam commented Jun 12, 2015

2015-06-12 21:02:14: jiang.qian commented


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

@totaam
Copy link
Collaborator Author

totaam commented Jun 12, 2015

2015-06-12 21:05:52: antoine changed owner from antoine to jiang.qian

@totaam
Copy link
Collaborator Author

totaam commented Jun 12, 2015

2015-06-12 21:05:52: antoine edited the issue description

@totaam
Copy link
Collaborator Author

totaam commented Jun 12, 2015

2015-06-12 21:05:52: antoine commented


FYI:

  • --packet-encoder=rencode is not necessary, it is the default if available
  • --compressor=lz4 - same

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?

@totaam
Copy link
Collaborator Author

totaam commented Jun 12, 2015

2015-06-12 21:11:57: jiang.qian commented


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.

@totaam
Copy link
Collaborator Author

totaam commented Jun 12, 2015

2015-06-12 21:20:11: antoine commented


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)

@totaam
Copy link
Collaborator Author

totaam commented Jun 12, 2015

2015-06-12 21:22:37: jiang.qian commented


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.

@totaam
Copy link
Collaborator Author

totaam commented Jun 12, 2015

2015-06-12 21:25:07: jiang.qian commented


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

@totaam
Copy link
Collaborator Author

totaam commented Jun 12, 2015

2015-06-12 21:26:10: antoine commented


But should I run it on client or server side?
[[BR]]
Please include both (client and server) for both of them! (server and client).

@totaam
Copy link
Collaborator Author

totaam commented Jun 12, 2015

2015-06-12 21:35:25: jiang.qian commented


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

@totaam
Copy link
Collaborator Author

totaam commented Jun 12, 2015

2015-06-12 21:53:56: antoine commented


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:

  • build your own modified dummy driver (there are very few code updates to this driver, so the patches should apply cleanly)
  • define a much smaller screen size in your xorg.conf, ie something like: DisplaySize 254 158 - until you get dpi values closer to what you want.

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).

@totaam
Copy link
Collaborator Author

totaam commented Jun 12, 2015

2015-06-12 21:59:48: jiang.qian changed status from new to closed

@totaam
Copy link
Collaborator Author

totaam commented Jun 12, 2015

2015-06-12 21:59:48: jiang.qian set resolution to fixed

@totaam
Copy link
Collaborator Author

totaam commented Jun 12, 2015

2015-06-12 21:59:48: jiang.qian commented


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.

@totaam totaam closed this as completed Jun 12, 2015
@totaam
Copy link
Collaborator Author

totaam commented Nov 13, 2015

2015-11-13 05:47:13: antoine commented


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

@totaam totaam added the v0.15.x label Jan 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant