linuxmint / muffin

The window management library for the Cinnamon desktop (libmuffin) and its sample WM binary (muffin)
GNU General Public License v2.0
196 stars 91 forks source link

Wine Fullscreen Apps are not Unredirected Correctly #701

Open li20034 opened 1 month ago

li20034 commented 1 month ago

Distribution

Mint 22

Package version

6.2.9

Graphics hardware in use

Intel HD 530

Frequency

Always

Bug description

Fullscreen apps running in Wine are still being composited likely negatively impacting performance and latency, rather than being unredirected so the app draws directly to the screen.

Steps to reproduce

  1. Turn on Settings -> General -> Compositor Options -> Disable Compositing for full-screen Windows
  2. Run a 3D demo or game in Wine in fullscreen. Something which runs at a high framerate and vsync off is desirable to really see the effects.
  3. ssh into the machine from another device
  4. in the ssh session, run sudo intel_gpu_top. You will observe that cinnamon is listed with a significant amount of 3D Render usage. Also there is no tearing even with vsync off in the app. This means that cinnamon is still compositing the window.
  5. For reference, try running the native app glmark2 --fullscreen instead of Wine. This time, the GPU render usage for cinnamon will go to (almost) 0 after a second or 2.

Expected behavior

Cinnamon should use almost 0 GPU in this scenario, and the window gets unredirected, meaning that with VSync off, tearing should be visible.

Additional information

I'm using Wine 9.0 from the official Ubuntu repos (not the winehq ppa). I listed the GPU as Intel HD 530 (on i5 6600), but the same issue also occurs on other Intel GPUs (e.g. Intel Iris Xe on i7-1180G7). I'm almost sure that this issue occurs with other GPUs too, but I do not have the hardware to test it.

Enokilis commented 4 weeks ago

I can confirm that Windows games don't bypass the compositor as expected (through Steam Proton). I found one case where the compositor appears to be bypassed on launch, but any change to the video settings thereafter engages composition until the game is restarted. KWin and Picom don't have this issue.

I also don't use Intel, and I use Arch btw.

li20034 commented 4 weeks ago

That's definitely interesting. So it's likely not an issue with Wine/Proton itself then, since KDE works. One thing I'm curious about is whether this happens on Gnome, since cinnamon and muffin are forks of gnome-shell and mutter respectively. I haven't had the chance to test that yet since I don't use Gnome.

The other thing I'm curious about is whether this issue occurred in Linux Mint 21. Because a few years ago, there was a very similar issue to this (in terms of symptoms) described here, which was fixed in late 2021.

Enokilis commented 4 weeks ago

The other thing I'm curious about is whether this issue occurred in Linux Mint 21. Because a few years ago, there was a very similar issue to this (in terms of symptoms) described here, which was fixed in late 2021.

I believe Muffin was recently reforked from upstream Mutter, nullifying most of the code issues from years ago. I was going to test GNOME too, but it seems to have a regression on X11 that prevents proper page flipping even in native apps. I'd have to try it on Debian stable.

Enokilis commented 3 weeks ago

I can now confirm that GNOME 43 behaves the exact same way as Cinnamon with the fullscreen compositor bypass bool checked, so it doesn't appear to be a Muffin issue specifically. I doubt the GNOME team has any interest in dealing with X11 issues, though.