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

[run_scaled] Incorrect scaling #3072

Closed
SamLukeYes opened this issue Apr 3, 2021 · 7 comments
Closed

[run_scaled] Incorrect scaling #3072

SamLukeYes opened this issue Apr 3, 2021 · 7 comments

Comments

@SamLukeYes
Copy link

SamLukeYes commented Apr 3, 2021

I'm using Arch Linux with GNOME (Wayland). run_scaled-git in AUR and xpra v4.0.6-3 from [community] repo can provide expected scaling. However, xpra-git v4.1.r257.g37b6dc36f-1 doesn't scale the application correctly.

Use the executable qq in AUR package linuxqq as an example. When running without run_scaled, its window looks like this:
image

With run_scaled qq, the window appears to be too large:
image

With run_scaled --scale=1 qq, the window size appears to be normal, but the words are too large for the interface:
image

Curiously, when executing run_scaled in Guake, this scaling issue is gone, though the words are greyed out (might be related to the dark theme):
image

All the other ways I tried to launching run_scaled, including GNOME Terminal, Nautilus Terminal, the terminal in VSCode, and launching through a desktop entry, can reproduce the issue. I also noticed that Xpra starting window is also smaller when run_scaled is launched with Guake. The version of run_scaled script itself (the original shell script, my own re-write version according to the shell script, or the one comes with the latest Xpra) seems to be unrelated. The tests above were performed with the script provided by the latest Xpra.

BTW, it would be nice to add input method support to run_scaled. Currently, I can't use the input method fcitx5 in an application scaled by run_scaled without editing the script to specify the arguments --input-method=keep and --start=fcitx5.

@totaam
Copy link
Collaborator

totaam commented Apr 3, 2021

Does the problem go away if you change start-child into start-child-after-connect in run_scaled?

My guess is that your applications are using the DPI from the vfb (no idea which one is used in arch - xvfb? Xdummy?), which is just the default value until the client actually connects.


BTW, it would be nice to add input method support to run_scaled

We can't just add every command line argument to run_scaled unless we add a -- argument that then passes every other command line argument to xpra. But then you wouldn't be able to use -- with a command, without first escaping it...

Another way of dealing with this is to make your settings permanent - if that's applicable to you:

echo "input-method=keep" >> ~/.config/xpra/xpra.conf

@SamLukeYes
Copy link
Author

Does the problem go away if you change start-child into start-child-after-connect in run_scaled?

Unfortunately, this doesn't solve the problem.

Another way of dealing with this is to make your settings permanent - if that's applicable to you:

echo "input-method=keep" >> ~/.config/xpra/xpra.conf

Oh thanks, this works for me.

@totaam
Copy link
Collaborator

totaam commented Apr 3, 2021

Unfortunately, this doesn't solve the problem.

Then xpra's xvfb may be misconfigured in ArchLinux.
It's probably using an unpatched Xdummy. Switch to Xvfb in /etc/xpra/conf.d/55_server_x11.conf.

@SamLukeYes
Copy link
Author

SamLukeYes commented Apr 3, 2021

It's probably using an unpatched Xdummy.

That's strange. I've been actually using xf86-video-dummy-xpra-patch. Doesn't it apply the patches properly?

Switch to Xvfb in /etc/xpra/conf.d/55_server_x11.conf.

This doesn't help either.


BTW, I just noticed that the original run_scaled script behaves a bit different from the one in this repo. Fonts are rendered in the expected size when using the original shell script (tested both on v4.1.r257 and v4.1.r260), so using that script with --scale=1 is a workaround. Sorry for having ignored that.

@totaam
Copy link
Collaborator

totaam commented Nov 6, 2021

We can't just add every command line argument to run_scaled unless we add a -- argument that then passes every other command line argument to xpra

And this is exactly what has been added: e6a2c64

As for the actual scaling issue, I'm still not sure what I am looking at.
Do you have simple steps so that I can reproduce the problem with a simple open-source app?

@SamLukeYes
Copy link
Author

Do you have simple steps so that I can reproduce the problem with a simple open-source app?

Had a try with Qt4 Designer.

Without run_scaled:

$ designer-qt4

2021-11-06 18-19-42屏幕截图

Text is in normal size, but the widgets are too small.

With run_scaled:

$ run_scaled designer-qt4

2021-11-06 18-24-07屏幕截图

Both text and widgets are too large for my screen.

$ run_scaled --scale=1 designer-qt4

2021-11-06 18-34-18屏幕截图

Widgets are likely in normal size, but the text is still a little too large.

Formally Guake sets GDK_BACKEND=x11, which causes different behavior than other Terminal Emulators. See Guake/guake#1871

$ export GDK_BACKEND=x11
$ run_scaled designer-qt4

2021-11-06 19-04-28屏幕截图

The text looks better this time. I also noticed that the Xpra window is smaller after setting GDK_BACKEND=x11. Not sure whether this is related.

Before setting GDK_BACKEND:
2021-11-06 19-14-25屏幕截图

After setting GDK_BACKEND=x11:
2021-11-06 19-12-40屏幕截图

The tests above are done in Wayland session. My current GNOME Shell version is 41.1, Xpra version is 4.2.2.

@totaam
Copy link
Collaborator

totaam commented Aug 28, 2023

I assume that this is fixed in newer versions.
In particular a patched dummy >= 0.4.1 with xpra v5.

@totaam totaam closed this as completed Aug 28, 2023
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

2 participants