mviereck / x11docker

Run GUI applications and desktops in docker and podman containers. Focus on security.
MIT License
5.62k stars 378 forks source link

xpra, xdummy, xvfb: dpi and screen size #230

Closed mviereck closed 4 years ago

mviereck commented 4 years ago

Ticket to collect some issues of @twyeld about dpi and screen size in xpra, xdummy and xvfb.

@twyeld wrote in https://github.com/mviereck/x11docker/issues/229#issuecomment-599006359:

note I tried the dpi switch but can't seem to get it to work - very low dpi in client - how to improve quality?

@twyeld wrote in https://xpra.org/trac/ticket/2610:

a short-term getaround is to set the screen size for x11docker - it seems 4:3 ratio gives the best result (~75x75dpi): x11docker --xvfb --size 1024x768 --dbus-system -- "-p 15500:15500" chromium-x11docker-test

using Xdummy instead of xvfb provides similar results = 88 x 75 dpi is there a chart showing pixel ratios/res and dpi for xdummy/xvfb?

@totaam wrote:

FYI: Should be OK, but if 1024x768 is smaller than your client's screen size, you may hit other issues later on: #349, #1132. (not sure about Xvfb since xpra generally uses Xdummy instead)

mviereck commented 4 years ago

I'll write some ideas and thoughts later. One quick thought: If Xdummy/Xvfb size is smaller than the client screen size, xpra scales up the client window. Have a look at the xpra client output if it says something about scaling. If the size of Xdummy or Xvfb is the same or greater than the client display, xpra should not scale the windows.

twyeld commented 4 years ago

with a bit of fiddling with the browser window I get the following output:

...
2020-03-16 20:43:47,083 client   1 broadway decoder initialized
2020-03-16 20:43:47,846 server virtual display now set to 1344x840 (best match for 1432x865)
2020-03-16 20:43:47,847 received updated display dimensions
2020-03-16 20:43:47,847 client display size is 1432x865 with 1 screen:
2020-03-16 20:43:47,847   HTML (379x229 mm - DPI: 95x95)
2020-03-16 20:43:47,847     Canvas
2020-03-16 20:43:47,850 DPI set to 70 x 70 (wanted 96 x 96)
2020-03-16 20:43:47,851  you may experience scaling problems, such as huge or small fonts, etc
2020-03-16 20:43:47,851  to fix this issue, try the dpi switch, or use a patched Xorg dummy driver
2020-03-16 20:43:47,851 sent updated screen size to 1 client: 1344x840 (max 1680x1050)
2020-03-16 20:43:48,032 client   1 broadway decoder initialized
...

I have a weird 16:10 display using 1680x1050 on a Dell Optiplex 7040 desktop comp with Nvidia 1050 Ti card

mviereck commented 4 years ago

server virtual display now set to 1344x840 (best match for 1432x865)

xpra has chosen a display size that is smaller than the client display size (browser window size). That leads to scaled up windows; that can look like a wrong dpi setting.

You should use a server window size that is same or bigger than the browser window size. I would assume that is already the case. Could you please run xrandr in the client and show me the output? If greater screen sizes are available but xpra chooses one that is to small, it is an xpra issue.

twyeld commented 4 years ago

hello mviereck and antoine - I will get back to this - it is worth resolving - I have just been pulled off this project for the moment - and with the current corona virus scare etc I need to finalise another project first...

On Fri, Mar 27, 2020 at 8:21 AM mviereck notifications@github.com wrote:

Closed #230 https://github.com/mviereck/x11docker/issues/230.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mviereck/x11docker/issues/230#event-3170133318, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHDK6T5LEIQUBFH5ISP7ESDRJPBPLANCNFSM4LL5Z2IQ .

mviereck commented 4 years ago

We can just re-open this ticket if you are looking at this again. :-) I just like to keep only active tickets open.

mviereck commented 4 years ago

Just a thought: It looks like an xpra issue. It might be fixed already in recent xpra versions. You could install xpra from the xpra/winswitch repository to make sure to have a recent xpra version.