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

Using xpra client on a wayland host with display scaling results in blurry windows #3994

Open
callegar opened this issue Sep 7, 2023 · 9 comments
Labels
bug Something isn't working

Comments

@callegar
Copy link

callegar commented Sep 7, 2023

Describe the bug

Launching xpra start ... on an X11 host. Trying to use xpra attach ... on a wayland client with display scaling (150%). Windows get displayed on the wayland machine but are a bit blurry (in any case readable). The --dpi option also seems to do nothing.

To Reproduce
See description

System Information (please complete the following information):

  • Server OS: Manjaro (current) or Ubuntu 22.04 with HWE
  • Client OS: Manjaro (current)
  • Xpra Server Version 4.5.1
  • Xpra Client Version 4.5.1
@callegar callegar added the bug Something isn't working label Sep 7, 2023
@totaam
Copy link
Collaborator

totaam commented Sep 7, 2023

Manjaro is not a supported distro.

on a wayland client with display scaling (150%)

What does this mean, where is it configured?

Please include a screenshot.

@callegar
Copy link
Author

callegar commented Sep 7, 2023

For what concerns xpra, manjaro should appear just like arch (which I guess is also an unsupported distro...)

Using KDE the wayland compositor lets you set a scaling factor for HiDPI displays. On the client I have it set to use 150% scaling, with an option to let legacy X11 applications do the scaling by themselves. The alternative would be do system scaling of X11 applications, which implies having Xwayland doing the scaling of otherwise unscaled apps. The latter necessarily results in some blur.

I'll attach a screenshot as soon as I am on the affected machine.

@totaam
Copy link
Collaborator

totaam commented Sep 8, 2023

with an option to let legacy X11 applications do the scaling by themselves

What / where is this?

The alternative would be do system scaling of X11 applications

xpra does not use Xwayland on the client.

@totaam
Copy link
Collaborator

totaam commented Oct 19, 2023

Xpra Server Version 4.5.1

This version does not exist!

@callegar
Copy link
Author

Sorry for the typo, that was 4.4.5

@totaam
Copy link
Collaborator

totaam commented Dec 25, 2023

FWIW: under Wayland, xpra does not use X11 at all. So the 150% scaling should be handled by Wayland and I'm not sure if there is an API for us to get the true dimensions of the window and the scaling factor to use with it.

@callegar
Copy link
Author

callegar commented May 4, 2024

Thanks for the info. Before further reporting, I have managed updating my system so that the reporting can be meaningful. I am now on xpra 6.0 on both the local machine and the remote one. This took some time because for some reason arch linux is stuck at 4.4.5 (strange as it may seem for a rolling distro). So now I am building my own xpra package for arch/manjaro and I hope I am doing it correctly.

Now, with a more recent xpra I can run it without the need to force it to X11 mode on the local host via the XDG_SESSION_TYPE=x11 environment variable. So far so good.

The problem is that the windows from the remote host remain extra blurry. This is an issue, specifically for terminal (konsole in my case) windows, where reading the text is possible but painful (to the extent of physical rather than metaphorical headaches). I believe that this depends on my specific situation where the remote machine is not HiDPI, but the local one is with desktop scaling set to 150%. My understanding is that xpra is unaware of this scaling (does 100%) that is done by the composer (that scales up to 150%) causing all the blurryness. I know that fractional scaling on wayland is a quite complicate thing if not worse, however, I understand that in order to provide a crisp display there is a way for wayland applications to know that the scaling is applied so that they can provide higher resolution rasters before the scaling. Waypipe seems to provide a more crisp display for konsole, so there should be a way to do it (obviously using waypipe in place of xpra is not an option, because xpra does much more and can deal with X11 applications).

As a final note, an interesting thing is that when you start xpra on the local host it says:

desktop size is 1707x1067:
2024-05-04 10:00:40,272   wayland-0 (300x190 mm - DPI: 145x143)

Here the 300x190mm is correct. However the 1707x1067 is the display resolution adjusted for the scaling. The real resolution is 2560x1600 and the 1707x1067 is actually the real resolution divided by 1.5 (150%). As a consequence the computed DPI is wrong. The real one is > 200dpi.

@callegar
Copy link
Author

callegar commented May 4, 2024

I have noticed that running xpra with --desktop-scaling=0.5 seems to get a crisp enough display at the correct scale. When you connect to the remote host you get an extra small konsole, but if you type konsole in it, then in the new window everything seems to be adjusted properly scale-wise.

Where does the 0.5 come from? Cannot really understand. 1/1.5 should be 0.667. So this looks like the ratio between the standard 96dpi and the actual ~200 dpi of my screen (can this be the case?). With 0.667 everything is definitely too large.

Unfortunately, with the desktop scaling at 0.5 there are other issues. When I scroll down the konsole and I get to the end, the konsole does not scroll but displays a messed up bottom line, until I scroll more... So there seems to be some rounding issue in understanding when the konsole should actually scroll.

@totaam totaam changed the title Using xpra xlient on a wayland host with display scaling results in blurry windows Using xpra client on a wayland host with display scaling results in blurry windows May 31, 2024
@totaam
Copy link
Collaborator

totaam commented Aug 24, 2024

See also: #4331 and #4326

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants