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

Incorrect mouse cursor offset with Wine 9.22+ #382

Open
1 task done
cobe571 opened this issue Nov 25, 2024 · 51 comments
Open
1 task done

Incorrect mouse cursor offset with Wine 9.22+ #382

cobe571 opened this issue Nov 25, 2024 · 51 comments

Comments

@cobe571
Copy link

cobe571 commented Nov 25, 2024

Thanks for giving yabridge a shot!

  • I read through both the troubleshooting and the known issues sections, and my issue wasn't listed there

Problem description

Hello everyone,
Today I update my Debian 12 (bookworm) with yabridge 5.1.1 to Kernel Linux 6.1.0-28-rt-amd64 x86_64 and Wine Staging 9.22

Just to be sure everything works fine in the end I follow these steps:

I delete the file:
/home/patrizio/.config/yabridgectl/config.toml

And the two directories:
/home/patrizio/.vst/yabridge/
/home/patrizio/.vst3/yabridge/

As usual I gave the commands:

:~$ /home/patrizio/.local/share/yabridge/yabridgectl add /home/patrizio/.vst/

:~$ /home/patrizio/.local/share/yabridge/yabridgectl add "$HOME/.wine/drive_c/Program Files/Common Files/VST3"

:~$ /home/patrizio/.local/share/yabridge/yabridgectl sync

Everything works fine! But...

All of the programs I use i.e. Carla Audio Plugin Host; Reaper and Ardour DAW recognize the plugins but when I open it in most cases they have a really strange behavior. Most of them don't show their GUI with controls and many others don't works at all.

I downgrade winehq-staging to version 9.21 and now everything works perfectly.

Note to remember. To downgrade Wine Staging version, all the files needed for the downgrade must be listed in the installation command:

:~$ sudo apt install winehq-staging=9.21~bookworm-1 wine-staging=9.21~bookworm-1 wine-staging-amd64=9.21~bookworm-1 wine-staging-i386=9.21~bookworm-1

Until it will be fixed I marked Wine Staging as blocked with:

:~$ sudo apt-mark hold winehq-staging

**

Hope it will be fixed very soon, cause I really like yabridge and I appreciate so very much I can finally use a full set of windows plugins into my Linux computers.

Thanks for the effort and please keep up with the good job!

~Patrizio.

What did you expect to happen?

That everything works as expected

What actually happened?

Loading plugins was a faliure: No GUI and most of the plugins not working at all

Operating system

Debian GNU/Linux 12 (bookworm)

How did you install yabridge?

github

yabridge version

5.1.1

yabridgectl version

5.1.1

Wine version

9.22

Plugin

Almost all of them

Plugin type

both VST2 and VST3

Plugin architecture

64-bit

Host

Carla; Reaper; Ardour 7

Desktop environment or WM

XFCE 4.18

GPU model

AMD PALM

GPU drivers and kernel

Mesa 22.3.6 on Kernel 6.1.0-28-rt-amd64

Debug log

No response

Anything else?

No response

@Abso793
Copy link

Abso793 commented Nov 25, 2024

Hello. I have this problem too. With wine-staging 9.22 i can't interact with the gui of the plugins. I have seen people mention this issue on winehq forum and on reddit too.

@siborg
Copy link

siborg commented Nov 25, 2024 via email

@pablo-888
Copy link

Same. I thought it was a wine-tkg problem so I switched to vanilla but then I noticed Arch was actually a couple of wine versions behind so that explains it. I couldn't interact with Melodyne.

@sandycorzeta
Copy link

This perhaps due Wine in 9.22 going into Wayland by default.
https://www.phoronix.com/news/Wine-9.22-Released

I have the same problem, but instead i can interact with the VST with wrong scaling? (i guess)
i use 1360x768 on my native resolution, but the VST seems going into over more than my native resolution in 9.22. So i have the button pressed wrong location.

9.21 doesn't have this problem.

@sandycorzeta
Copy link

sandycorzeta commented Nov 26, 2024

Here are some video preview of what happened in my computer.
It looks like the window coordinate initialization is not properly configured when the plugin being launched.
Perhaps almost looks like the same bug from #368 .

My system is Fedora 41 using Wine 9.22 copr build from patrickl

2024-11-26.14-48-38.mp4

@robbert-vdh robbert-vdh pinned this issue Nov 27, 2024
@robbert-vdh
Copy link
Owner

Thanks for letting me know about this! I'll probably need to dive into what actually changed between Wine 9.21 and 9.22 to figure out what's happening here. I'll try to find time for that this weekend. For now you'll have to downgrade to an earlier version of Wine.

This perhaps due Wine in 9.22 going into Wayland by default.

yabridge has been unsetting WAYLAND_DISPLAY since early 2023 in anticipation for that on its own should not be causing any problems

I have the same problem, but instead i can interact with the VST with wrong scaling? (i guess)
i use 1360x768 on my native resolution, but the VST seems going into over more than my native resolution in 9.22. So i have the button pressed wrong location.

Are you using yabridge 5.1.1? Wine 9.17 changed how it handles DPI scaling, which did cause issues like this. Yabridge 5.1.1 should scale fine with all current Wine versions.

@bsedin
Copy link

bsedin commented Nov 27, 2024

I have same problem on wine 9.22, downgrading wine to 9.21 fixes it.
yabridge compiled from a82bd51 (with DPI scaling fix). I will try to test on latest master branch

@sandycorzeta
Copy link

Are you using yabridge 5.1.1? Wine 9.17 changed how it handles DPI scaling, which did cause issues like this. Yabridge 5.1.1 should scale fine with all current Wine versions.

Yes i'm using yabridge 5.1.1 compiled from patrickl COPR when im testing this.

@ArtikusHG
Copy link

For me, this also affects older wine versions. This started happening to me when I upgraded to 9.20. Downgrading to 9.17 only partially fixed it - on 9.20 I couldn't use the mouse to interact with the GUI at all, on 9.17 it would work on some plugins, but not others (Melodyne was still broken). The only version that works without issues currently for me is 9.21 (even with Melodyne).

Btw this is on Arch running the official packages for both yabridge and wine (switched to wine-staging to install 9.21 though). Don't think it matters, but just in case, my DAW is Reaper, my DE is GNOME on Wayland and I'm running it all through distrobox on Fedora Silverblue.

@Nekkowe
Copy link

Nekkowe commented Nov 30, 2024

I'm experiencing the same problem.
Linux Mint, X11, Reaper, wine-devel 9.22, yabridgectl 5.1.1
The plugin UIs do not react to the mouse in any way whatsoever, every one I've tried appears completely frozen.

Downgrading to 9.21 fixed it for me too.

@robbert-vdh
Copy link
Owner

I don't know if I still have the time to cook up a yabridge-side workaround for this today (and if that's possible to do in a reasonably sane manner) but for context, this is the Wine commit that introduced this issue's specific regression where GUI interaction just no longer works:

Patch: https://gitlab.winehq.org/wine/wine/-/merge_requests/6569
Specific commit causing the problem (through interaction with an earlier commit): wine-mirror/wine@d8b5a3a

The ConfigureNotify events sent by yabridge are being ignored because of those new checks. These events are what tells Wine where on the screen the window actually is. You'll notice that if you move a plugin window around to align with the very top left corner of your screen, mouse interaction still works as expected with Wine 9.22. The same PR added the following line, which causes that wm_state_serial flag to no longer be cleared, causing the problem:

https://github.com/robbert-vdh/wine/blob/d8b5a3ae129e0971e71fcf6e95387d8d1e35e646/dlls/winex11.drv/window.c#L1442-L1443

@PennRobotics
Copy link

Because the problem is already bisected, I imagine a fix is coming in the next release. Nonetheless, Fedora users can use:

sudo dnf install --allow-downgrade winehq-staging-9.21
sudo dnf versionlock add winehq-staging

@chmaha
Copy link

chmaha commented Dec 4, 2024

Because the problem is already bisected, I imagine a fix is coming in the next release. Nonetheless, Fedora users can use:

sudo dnf install --allow-downgrade winehq-staging-9.21
sudo dnf versionlock add winehq-staging

Or alternatively just use the official Fedora 41 repo and install wine 9.15 which is apparently based off wine-staging.

@Skygge666
Copy link

Side question about the Wayland: Is there Wayland support planned for Yabridge? I wonder if this could make the proper plugin GUI available in Presonus Studio One.... Thanks!

@RustoMCSpit
Copy link

same here Bitwig 5.2.7 linux mint .debian

@0CCULTIST
Copy link

0CCULTIST commented Dec 7, 2024

Still issues after Wine 10. For lazy people on Debian Bookworm:

sudo apt install --allow-downgrades winehq-staging=9.21~bookworm-1 wine-staging=9.21~bookworm-1 wine-staging-amd64=9.21~bookworm-1 wine-staging-i386=9.21~bookworm-1 && sudo apt-mark hold winehq-staging wine-staging wine-staging-amd64 wine-staging-i386

Replace "hold" with "unhold" when (or even IF at this point) WINE fixes this

9.21 is the last working version.

@RustoMCSpit
Copy link

i think this is possibly related to a much older bug report made about neuralnote running through yabridge, not certain however https://bugs.winehq.org/show_bug.cgi?id=56774

@Lairizzle
Copy link

Confirmed same issue and downgrade to 9.21 and a reboot fixed it for me.

@cnschn
Copy link

cnschn commented Dec 15, 2024

@robbert-vdh any ideas how much effort it would be to work around this from the yabridge side? I'd prefer not to downgrade wine, and while moving all plugin windows to 0,0 works for now it's not exactly convenient 😄

@robbert-vdh
Copy link
Owner

@cnschn That probably won't possible do to in a way that keeps the old behavior, and that won't break immediately again after the next Wine release. I briefly checked if I could get something to work by moving the window's position around and then compensating with negative translations but that didn't really work and is super janky.

I don't think the Wine people are going to change something on their side that would make this work again anytime soon though. Maybe they'll accept a patch from me that would make this work properly without any hacks, but I currently also don't really have the time to work on that.

@cnschn
Copy link

cnschn commented Dec 16, 2024

That's unfortunate, but understandable.

I really don't want to downgrade/pin wine to an older version, does anyone have any recommendations on how to manage prefixes using non-system versions of wine (on arch in my case)? I'm using Lutris for some games/applications already, maybe setting up a fixed version prefix for VSTs using that could be an option?

@cdunford
Copy link

Experiencing same issue on arch with 9.22 - does anyone know if there is an open issue in wine to address this?

@siborg
Copy link

siborg commented Dec 22, 2024 via email

@cdunford
Copy link

Yeah I'll see about downgrading - that's always a bit of a headache on arch. Would be stellar if someone was able to fix this at some point.

@siborg
Copy link

siborg commented Dec 22, 2024 via email

@siborg
Copy link

siborg commented Dec 22, 2024 via email

@Lord-Formaldahyde-Brick

I think this problem with 9.22 is wider than just yabridge. Carla fails too plus the plugins in Photoshop CS2 (which was the last Adobe product I ever bought...think on Adobe! ) All fail to respond to mouse, or at least not know the coordinates of the pointer.

@DJZeroAction
Copy link

Ive downgraded to wine 9.21 (tkg build). VSTs are rendering (not frozen either) (9.22+ gave me a black screen), but mouse and keyboard interactions does not work. dxvk is installed.

@singularity098
Copy link

singularity098 commented Jan 10, 2025

Hey folks, I just wanted to suggest a way to work around this which might help some of you. I am on OpenSUSE and downgrading Wine is not trivial, and not worth the effort for me personally.

Instead, I noticed that Wine seems to be registering the mouse clicks using my absolute screen coordinates, as if the left-most top-most pixel of the VST display were exactly at pixel position 0,0 on the screen. I noticed this because the mouseclicks in EZdrummer were always registering down and to the right of where I intended them.

In other words, the further your VST window happens to be positioned away from the top-left corner of the screen, the further your mouse clicks will be from where you intended.

So to work around it, I am having success simply by right clicking the title bar of my VST and clicking move, and then position the VST window so that it is where Wine apparently thinks it is, with the top-left most corner of the VST display aligned with the top-left most corner of the monitor. You will have to push the title bar off the screen if you want your clicks to be exact, which is why I rightclick the title bar and move that way instead of dragging the title bar as you would usually do. This works in Reaper with KDE... methods may be different in other desktop environments and DAWs.

@nicolalandro
Copy link

I have same mouse shifting problem on Endeavour OS, I fixed it by downgrading from 9.22 to 9.21:

wget https://archive.archlinux.org/packages/w/wine-staging/wine-staging-9.21-1-x86_64.pkg.tar.zst
sudo pacman -U wine-staging-9.21-1-x86_64.pkg.tar.zst

@mrbumpy409
Copy link

So to work around it, I am having success simply by right clicking the title bar of my VST and clicking move, and then position the VST window so that it is where Wine apparently thinks it is, with the top-left most corner of the VST display aligned with the top-left most corner of the monitor.

By default in KDE Plasma, you can also hold down the left Windows key and drag a window by clicking anywhere within the window. It might be Left Alt instead if you have upgraded from an older Plasma version.

@ArAM1db33tz
Copy link

I have same mouse shifting problem on Endeavour OS, I fixed it by downgrading from 9.22 to 9.21:

I take it I would need to install Wine-9-21 from archive too as it needs to remove it when pacman downgrades staging?

@olly1240
Copy link

I wrote a PKGBUILD for Arch based distros with a crude band-aid fix that makes the cursor behave normally but menus are still wonky. If anyone is interested it is 9.22 based
I also compiled it in the releases section and should be reproducible, mostly because it took my machine more than 30 mins to compile.
https://github.com/olly1240/wine-window-fix
As I have seen this should be a temporary solution that might be solved the update after wine 10

@robbert-vdh robbert-vdh changed the title Most VST3s have strange behavior after Wine Staging update Incorrect mouse cursor offset with Wine 9.22+ Jan 19, 2025
@robbert-vdh robbert-vdh marked this as a duplicate of #393 Jan 19, 2025
@robbert-vdh robbert-vdh marked this as a duplicate of #391 Jan 19, 2025
@ManuLinares
Copy link

I wrote a PKGBUILD for Arch based distros with a crude band-aid fix that makes the cursor behave normally but menus are still wonky. If anyone is interested it is 9.22 based I also compiled it in the releases section and should be reproducible, mostly because it took my machine more than 30 mins to compile. https://github.com/olly1240/wine-window-fix As I have seen this should be a temporary solution that might be solved the update after wine 10

Is this being patched in upstream wine?
Can you link to the commit or PR?

@PaulTGG
Copy link

PaulTGG commented Jan 20, 2025

I wrote a PKGBUILD for Arch based distros with a crude band-aid fix that makes the cursor behave normally but menus are still wonky. If anyone is interested it is 9.22 based I also compiled it in the releases section and should be reproducible, mostly because it took my machine more than 30 mins to compile. https://github.com/olly1240/wine-window-fix As I have seen this should be a temporary solution that might be solved the update after wine 10

Is this being patched in upstream wine? Can you link to the commit or PR?

Last I saw, it's not currently being worked on, although the Wine team are aware: https://gitlab.winehq.org/wine/wine/-/merge_requests/6569#note_92037

@ManuLinares
Copy link

Is this being patched in upstream wine? Can you link to the commit or PR?

Last I saw, it's not currently being worked on, although the Wine team are aware: https://gitlab.winehq.org/wine/wine/-/merge_requests/6569#note_92037

That is merged. Can somebody test with the merge?

@PaulTGG
Copy link

PaulTGG commented Jan 20, 2025

That is merged. Can somebody test with the merge?

The discussion I pointed to is about a fix for a problem that merge created. If you scroll up the thread, you'll see that @robbert-vdh brought up that that particular merge broke stuff.

@onion-mane
Copy link

Faced the same issue on Arch (Hyprland). Downgrading wine-staging to 9.21 and 9.20 did not help me. But wine-staging 9.19 works without any issues!

@ManuLinares
Copy link

Just to confirm, bug is still present in wine 10.0

@olly1240
Copy link

Just to confirm, bug is still present in wine 10.0

I updated my PKGBUILD to 10.0 for anyone interested

@rolodoom
Copy link

I just tested WineHQ 10 Stable on Debian bookworm 12, and having same problem. SO I downgrade to previous WineHQ 9 Stable to keep plugins working.

@recallmenot
Copy link

It would appear the issue is in the process of being solved.
The preliminary patch offered in the bug report does not solve it entirely - context menus will still be positioned to absolute coordinates but that's bearable since that's at least on-screen
I managed to make the patch work with wine-tkg on arch:

git clone https://github.com/Frogging-Family/wine-tkg-git.git
cd wine-tkg-git/wine-tkg-git
makepkg -os
wget https://gitlab.winehq.org/-/project/5/uploads/dea8a1e711846f7e7642c16eacd284b4/bug51357.patch --output-document=src/wine-git/bug51357.patch

patch --dry-run -ruN -p 1 -d src/wine-git  < src/wine-git/bug51357.patch
patch -ruN -p 1 -d src/wine-git  < src/wine-git/bug51357.patch

cp wine-tkg-patches/misc/30-win32-aliases.conf src/
cp wine-tkg-patches/misc/wine-binfmt.conf src/

makepkg -ei

Those manual cp ops are necessary as the patching apparently breaks something, no idea why.

@tarnith
Copy link

tarnith commented Jan 28, 2025

Can confirm this still breaks Serum's GUI using Yabridge/Bitwig/Arch

Downgrade to 9.21 staging solves it over here as well

@Abso793
Copy link

Abso793 commented Jan 28, 2025

Hello,

I followed recallmenot's instructions, and everything is functioning perfectly with Wine-Tkg-git (v10). This is my first time using the TKG version, and not only does it work seamlessly, but it also appears to run every plugin more efficiently. Big thank you recallmenot. Wishing you and your loved ones all the best :)

@gearcoded
Copy link

@singularity098,
Thank you for the tips! I also discovered that, but I thought it would work only if I maximize the window.

@robbert-vdh,
Maybe it is possible to add some hack to yabridge if it detects the specific wine versions (like 9.22-10.0)?
I prefer using the stable version and was surprised that the upgrade to wine 10.0 from wine 9.0 made most of the plugins unusable (until I discovered a hack regarding the 0,0 position).

The first step was to downgrade to 9.0, but I thought I broke something. So, next time I will need to carefully check which packages I need to install for Ubuntu:
https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/main/

Previously, I tried to install every package with the stable and 9.0 keys in the name. And it turned out even the libc library was downgraded.

@PennRobotics
Copy link

PennRobotics commented Jan 30, 2025

Based on Robbert's commit history and comments (here and elsewhere), I get the sense that he is in an unfortunate position:

  1. someone else broke his code
  2. not a ton of free time and/or motivation to work on this
  3. a lot of users—likely most who (like me) are unfamiliar with the display/event code of both Windows and Linux

Wine broke this but (for presumably good reasons) is unlikely to revert its changes. I hate dirty workarounds and left-in legacy code as much as the next developer1, but it would've been nice for Wine to leave the old behavior behind a flag even if it's "technically incorrect". yabridge could call the flag, everyone else gets the "improved" code, and a fix could be introduced at a leisurely pace without anyone even noticing.

A month ago, there were a few ideas posed by Rémi on the Wine PR but they all seem like theoreticals (no specific advice on function calls, code change examples, etc.) and all would require a fix from Robbert. That might not be the best solution if the code worked earlier, plus getting back up to speed on code you wrote years ago can be frustrating. Whoever is responsible for the fix—or even if someone from the community wants to step up, which would also take time and still might break things—Linux DAW users are having problems today. What, then, can we do to actually help?

There have been a few recent edits in the mouse DLL, and in one of those cases (a touchscreen issue) a log was requested and then a bugfix applied on Wine's side nearly immediately.

(Call to action) Perhaps it would help to append the yabridge Wine bug report with a debug log? The requested debug flags from the last fix to the mouse DLL were WINEDEBUG=+timestamp,+pid,+loaddll,+x11drv,+event,+cursor,+win,+msg,+message,+hid. I believe they'd want the user to then click in the top-left, bottom-right, and somewhere in the middle of a plugin window (plus possibly move the plugin window and repeat) and then upload that log.

(I'm not sure when I'd have free time to do this myself, but I can add it to the giant to-do list.)

(Alternately, upload this log to the PR discussion, but IMHO the bug tracker would be better, in case other programs have similar issues and so commits can link to the bug they fix.)

At the very least, Wine devs could review that debug log, check if the X11 mouse DLL needs more work (or at least add a warning message for the affected codepath) or confirm it's a problem with only yabridge and then offer concrete advice?


Aside: With the general community moving toward Wayland (some more reluctantly than others) is there some merit in figuring out how yabridge should work without X11 in the distant future?

Footnotes

  1. This is misleading. If dirty workaround code works, I love it.

@gearcoded
Copy link

@PennRobotics,
Thank you for sharing the links. It turns out, the developer was working behind the scenes! that's good to know. And after reading the last comments from WineHQ, this looks like it can be fixed in 10.1-10.9 or 11.0. In any case, the easiest way is to downgrade.
However, I hope, yabridge will still have the version for X11 at least in the near 5 years. I don't see any reason to switch to Wayland before that.

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