QubesOS / qubes-issues

The Qubes OS Project issue tracker
https://www.qubes-os.org/doc/issue-tracking/
541 stars 48 forks source link

Render issues when using Gdk/WindowScalingFactor for 4k resolution #8024

Open techge opened 1 year ago

techge commented 1 year ago

Qubes OS release

4.1

Brief summary

I'm using 4k screens in Qubes since working with it (for about 1 year). Sure, it needed some tweaking, but my setup finally worked fine.

Some apps need special treatment to get a consistent scaling, by using GDK_SCALE and GDK_DPI_SCALE as described here. The latter variable is not honored by GDK4 apps anymore. This is where my martyrium started. I ended up using the following dconf settings to get everything scaled correctly again:

[org/gnome/desktop/interface]
scaling-factor=2
text-scaling-factor=1.75

[org/gnome/settings-daemon/plugins/xsettings]
overrides={'Xft/DPI': <196608>, 'Gdk/WindowScalingFactor': <2>}

And here finally starts the issue: Using the Gdk/WindowScalingFactor I ran into rendering troubles the more vms/windows I start. The symptoms are white windows whenever switching between i3 panes. After a while they might render correctly. I could click on things of the window (it is recognized), but I can't see anything. Furthermore, journalctl shows me the same error message as describe in #5674. When I switched back the setup (specifically, stopped using Gdk/WindowScalingFactor), the message disappeared again and the issue itself as well.

I already maxed up the values mentioned in the issue to gnttab_max_frames=2048 gnttab_max_maptrack_frames=4096 to maybe fix the issue this way. Doubling the values again gave me some weird load issues and as I do not really know, what is happening there anyway, I switched back for now. (Maybe this still is a quick fix, I dunno.)

Steps to reproduce

Use a 4k screen setup (I guess) and use Gdk/WindowScalingFactor with value 2. This issue may only appears in i3, I can not tell for sure.

Expected behavior

Changing WindowScalingFactor should not effect rendering. As it is generally working for 4k with my old settings, it is maybe something fixable even though the long open #1951 might suggest otherwise.

Actual behavior

Setting WindowScalingFactor provokes render issues.

Using my the setup together with GDK_DPI_SCALE variable does not work anymore with GDK4 application as these does not honor this var anymore (see this discussion as good overview regarding this variable that was used as a workaround https://bugs.kde.org/show_bug.cgi?id=442901). So you can either live with inconsitently scaled applications or have render issues all the way.

DemiMarie commented 1 year ago

The correct fix is to switch to Wayland, which handles scaling natively. I’m not sure if it is practical to fix this with the current GUI agent and daemon.

Setting milestone to R4.3 because that is the earliest that a Wayland-capable GUI daemon could be made.

marmarek commented 1 year ago

The symptoms are white windows whenever switching between i3 panes.

@DemiMarie missing MSG_SHMIMAGE message? While using Wayland might help by simply using completely different execution path, it doesn't mean there isn't some bug in the current code. It doesn't look like something fundamentally incompatible with X11 agent/daemon, so, adjusting milestone appropriately.

@techge you can try enabling debugging (qvm-prefs VMNAME debug true), and then checking /var/log/qubes/guid.VMNAME.log (where VMNAME is the actual name of the VM) - there will be a lot of stuff, but try to correlate with windows that windows that get white. Using xwininfo may help with getting window IDs.

techge commented 1 year ago

Not that I would understand a lot of it, but it seems it hast troubles finding the window size while communicating with gsetting dameon, right? This makes sense as it is what is changed in the setting above.

guid.disp2138.log

techge commented 9 months ago

I used the settings in my arch template for some weeks now without any problem. I thought that it might got solved in 4.2 and wanted to try it with the fedora template too. However, the problems described above reappeared after switching settings in fedora as well.

That makes me wonder, if some kind of packaged could have changed in arch already, but is missing in fedora :thinking:

EDIT: clarify relation to 4.2

andrewdavidwong commented 9 months ago

I used the settings in my arch template for some weeks now without any problem. I thought then it might 4.2 related and wanted to try it with the fedora template too. However, the problems described above reappeared after switching settings in fedora.

Are you saying that this also affects 4.2?

techge commented 8 months ago

Are you saying that this also affects 4.2?

Exactly.