-
Notifications
You must be signed in to change notification settings - Fork 106
[WIP] [X11] Workaround 1x1 Wine window to allow unredirect. #715
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
base: master
Are you sure you want to change the base?
Conversation
|
Update on this, I noticed that screen recording software like OBS Studio breaks in-game VSYNC and enforces BLIT rendering until I close screen recorder in case with such buggy windows, I figured out that I also should avoid overriding of |
|
Would it also be possible to fix the root of the issue? |
|
Just merged and summarized commits. |
|
As far as I understand, fixing it not planned at all, right? To be more correct - workarounding. And #701 issue is still opened for around 9 months and successfully ignored by development team. I have found report on Wine's Bugzilla created in 2021 And my changes aimed to ignore this 1x1 window, otherwise window will not be unredirected, so that compositor will reduce performance and cause microstuttering on monitor side. I can confirm that is weird that native games from Steam also have the same issue. And again, I will add that issue is not reproducible with games using Vulkan API (including those running with DXVK or VKD3D), only OpenGL stuff suffers from that. In case someone uses Arch Linux like me, you can build and install my fork: # Official PKGBUILD from Arch Linux GitLab
git clone https://gitlab.archlinux.org/archlinux/packaging/packages/muffin
# Go to directory with PKGBUILD
cd muffin/
# Install build dependencies, download and extract source code
makepkg --syncdeps --nobuild
# Replace extracted source code with one from my fork
rm -rf src/muffin-6.4.1
git clone https://github.com/itz-me-zappex/muffin-fixed-unredirection.git src/muffin-6.4.1
# Build and install
makepkg -iOr just modify PKGBUILD by skipping checksums and replacing source with one from my repository. After installation press |
|
Followed the steps, but I still see a visible 1x1 window in the corner and get no flipping. |
1x1 window will not disappear. About flipping, make sure in that you have "Allow flipping" and "Show API indicator" enabled in The most important: open system settings, then go to |
|
+1 for this, without this patch gsync isn't working in games. |
|
Thanks for looking into this! I disagree with the change in In fact, it kinda implies the opposite.. that muffin knows best by default, and that enabling it prevents composition on all fullscreen apps (which even isn't true, since there are exceptions there as well). |
|
When it's set to False (by default) it composites most fullscreen windows, but not all of them. For instance if a window specially requests to be unredirected, it doesn't composite it. I believe that's a good default for most people. When it's set to True, it lets most windows be unredirected, but again with some exceptions. It's a safe setting, not a setting that really empowers the user to force anything for all fullscreen windows. If we want to give users more control over this, or let them troubleshoot better, we need to rethink the configuration options. I don't agree with changing the default behavior but I'm open to making this easier to troubleshoot and offer options which give users more control. One way could be to provide a combo instead of just a toggle, with 4 options instead of just 2. Composite-all, composite-most (default, equivalent to false right now), composite-few (equivalent to true right now), composite-none. Another way could be to list recent windows and let users enforce compositing or unredirection for specific windows. All in all though, I think that's a feature improvement and it's unlikely to be ready right now for 6.6. It should be considered separate from the issue at hand here, which is how we handle these 1x1px windows. |
|
Okay, no problem, I will revert changes in |
53fcc4c to
68ba84f
Compare
|
Hi I did some testing on this. For now I reverted the repositioning of that settings check so I could see just how the 1x1 workarounds would affect things. I can see it had an impact with Geometry Dash, but every other game I've tested (so far) unredirects fine at fullscreen on git master, or wouldn't unredirect, and neither version made a difference. I also observed the check in I'm sort of leaning into trying to make it a bit easier to force a window to un-redirect, as it seems as though there will always be exceptions. I worry about side effects of these small workarounds with other applications (who may also be doing odd things with windows). |
Hi, I already reverted changes related to handling unredirect and kept only workaround.
Yes, especially noticeable in Geometry Dash, this is why I started figuring with this out, and as I said in PR's description, issue affects all OpenGL games running through Wine/Proton (Lutris, Steam, Heroic etc.), and even native ones that running from Steam (those are FNA by the way). No idea why to be honest. Vulkan/DXVK/VKD3D games are not affected, WINED3D also not affected, despite a fact this is OpenGL. Affected OpenGL games in my testing:
Other games in my libraries using DXVK/VKD3D, so nothing to test anymore. And I did not check master branch for now, still using outdated source existing in forked repo, will try update on weekends.
When I tinkered with source code (two previous PRs were shitty so I closed them), I noticed that I could not obtain proper window rectangles "manually" using already existing functions (i.e. explicitly, not using ones from event) of parent window when 1x1 window appears. This is why I tried to get those directly from X11. I still did not notice any side effect of this workaround (despite a fact Here is one guy who did not report any issue on this workaround and said it fixed not working GSYNC (makes a sense, because window should be unredirected for this), and this comment has 2 thumbs up (mine does not count). Here. |
|
Probably we need to create a function that checks for whether window has |
|
Update: installed latest release from releases page (it matches master branch for now, 6ea2c8c), and no issue with native Terraria anymore (don't have Starbound installed now), but I'm on Arch, PKGBUILD I used is here: # Maintainer: Bruno Pagani <[email protected]>
# Contributor: Eli Schwartz <[email protected]>
# Contributor: Alexandre Filgueira <[email protected]>
# Contributor: Adam Hani Schakaki <[email protected]>
# Contributor: Ner0
pkgname=muffin
pkgver=6.4.1
pkgrel=1
pkgdesc="Cinnamon window manager based on Mutter"
arch=(x86_64)
url="https://github.com/linuxmint/${pkgname}"
license=(GPL)
depends=(cinnamon-desktop gobject-introspection-runtime libcanberra libinput
libsm libxkbcommon-x11 startup-notification zenity graphene pipewire xorg-xwayland)
makedepends=(meson intltool gobject-introspection wayland-protocols glib2-devel egl-wayland)
options=(!emptydirs)
source=(https://github.com/linuxmint/muffin/archive/refs/tags/master.mint22.tar.gz)
sha256sums=('SKIP')
b2sums=('SKIP')
build() {
arch-meson build muffin-master.mint22 -D egl_device=true -D wayland_eglstream=true
meson compile -C build
}
package() {
meson install --destdir="${pkgdir}" -C build
}P.S.: Vanilla Proton 10.0-3, exactly the same behavior as on Proton 8.0 and 9.0. Neither Valve nor Wine developers seem going to fix this in proper way. |
Description
Finally, after previous two PRs I have created (and closed) with chunky workarounds and wild activity in #701, I have found solution and figured out that root of issue is bugged rectangles of child windows (
1x1+0+0), which are created by OpenGL games running through Wine/Proton (e.g. Geometry Dash) and even native ones running through Steam (e.g. native Terraria). That does not happen with OpenGL games running completely natively (i.e. w/o Steam container) and does not happen with Vulkan games at all as those are have proper rectangles on child windows asxwininfo -tree -rootshows, so solution oriented only at that specific case.Solution
So, the best way I found to solve this, is just not override currently handled window rectangles with new (child) ones if those are bugged (i.e. resolution of child reported as
1x1), that makes muffin use parent window rectangles which are correct.That "filter" should be used two times:
window.c: to allow FLIP unredirection for such windows by handling those with proper rectangles.window-x11.c: to avoid unredirection breakage if window mode appears changed e.g. from fullscreen to windowed and back, or when OSD stuff draws over unredirected window.Also I fixed issue in
meta-surface-actor-x11.crelated to handling internal unredirect requests if "Disable compositing for full-screen windows" disabled in settings (or through dconf), as those requests always have been handled and fullscreen windows were unredirected.Closes #701.