-
-
Notifications
You must be signed in to change notification settings - Fork 69
Multiple wine10 embedding fixes #428
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
Multiple wine10 embedding fixes #428
Conversation
We just need this constant, so there's no real need to add the additional dependency. There's also no real harm in adding it, but it would result in additional work for every packager.
This shouldn't be necessary anymore. It can always be added back later if there is still flickering.
I'm not sure if this would still be necessary with the new embedding approach, but it definitely does cause more problems than it solves.
This seems to behave more reliably than resizing the window with `xcb_configure_window()`, solving some of the client area issues with Wine 9.21.
There's still a bug here. When the window is resized, the mouse issue will randomly return or not. I think some part of the code must be considering two different windows somehow. |
It looks like sometimes on resize it goes into a loop. Looks HiDPI related. Here is a correct resize:
And here is one that loops:
When it goes into the loop the plugin is still responsive, but the mouse cursor offset issue comes back. Resizing it again until the loop stops fixes the issue. |
Ardour brings up the plugin UI before the host window is visible, and it is missing some properties. Using WM_WINDOW_ROLE instead of WM_STATE makes it work. For reference, these are the properties that are set on the window at the time of plugin GUI instantiation: _NET_WM_ICON(CARDINAL) = Icon (16 x 16): WM_WINDOW_ROLE(STRING) = "plugin_ui" _NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 6294918 _NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_UTILITY _NET_WM_USER_TIME_WINDOW(WINDOW): window id # 0x600d85 WM_CLIENT_LEADER(WINDOW): window id # 0x600001 _NET_WM_PID(CARDINAL) = 1604801 WM_LOCALE_NAME(STRING) = "en_US.UTF-8" WM_CLIENT_MACHINE(STRING) = "homura" WM_NORMAL_HINTS(WM_SIZE_HINTS): program specified size: 521 by 46 WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST WM_CLASS(STRING) = "ardour-8.12.0", "Ardour-8.12.0" WM_ICON_NAME(STRING) = "Audio 1: Melodyne (by Celemony) [VST3]" _NET_WM_ICON_NAME(UTF8_STRING) = "Audio 1: Melodyne (by Celemony) [VST3]" WM_NAME(STRING) = "Audio 1: Melodyne (by Celemony) [VST3]" _NET_WM_NAME(UTF8_STRING) = "Audio 1: Melodyne (by Celemony) [VST3]"
59aad89
to
0626fa4
Compare
Pushed a hacky fix for that. |
Spectrasonics Trilian seems to still have a mouse offset, but this time equal to the delta between the plugin window and the host window (the height of the Ardour plugin header bar). Hmm... |
Korg M1 (VST3) fails to update host window size when the plugin scale is changed via the UI. Edit: Similar problem with FabFilter plugins, except here the UI briefly glitches to the new size before returning to the host window size. The mouse then doesn't work until the plugin is manually resized. |
Melodyne does not allow resizing to smaller than the initial size, but the plugin remembers the last window size and uses that as its initial size, so once you expand it and close it, you can never make it smaller again. I seem to remember this was always an issue? Edit: Yeah, this one is an Ardour bug: https://tracker.ardour.org/view.php?id=8764 |
Testing with FabFilter, not sure if this is a DAW bug. It looks like it immediately requests a resize back to the original size.
|
It looks like Ardour has various issues with resizing, so I'm going to ignore that part. That leaves the Trilian offset... Trilian seems to do something weird here. The window gets created early, when the parent window is not yet displayed, and then reparented on display. VST2 behavior? But other VST2 plugins work fine... |
Just tested the fork. PG-8X still doesn't work. BUT SCVA still works, sort of. When I switch to view another plugin and then back, it breaks, but otherwise I can access the popout menus just fine. And BassMidiVST suddenly works as well. Amazing! 2025-05-22.10-41-37.mp4 |
The diff worked! No issues with SCVA. And PG-8X suddenly works too. I'm very happy now :) |
Sometimes the plugin size might be off-by-one due to HiDPI scaling. If so, pretend it's actually the size that was requested, to avoid ending up in an infinite loop.
Instead of creating the window as 128x128 and then resizing, create it with the size requested by the plugin. Fixes Korg VST3 plugins.
This fixes issues with various plugins such as PG-8X and SCVA.
d9a8136
to
bd3c81f
Compare
Thanks for the feedback! I've added that fix and also fixed the VST2 offset in Ardour (seems M1 was also broken, not sure why I thought it wasn't). |
For VST2 in Ardour, it seems Ardour is doing its own WM/wrapper window thing too. In this case, the plugin gets absolute ConfigureNotify events that are already in the root coordinate space, so just use those coordinates and ignore the host window. Also fix the dimensions, which should always be those of the parent window, not the host window. If the parent is the host window, still track its geometry separately, and just don't add in the host window dimensions in this case either.
Once we get a single absolute ConfigureNotify event, we assume they will keep coming and ignore any relative ones. The relative computation only works if the parent window is a direct descendant of the host window, which may not be the case. To fully fix this in the general case (only relative ConfigureNotify events) we would have to walk the window hierarchy and add up all the offsets until the host window, but so far the only known case of an extra level (Ardour VST2) also sends absolute ConfigureNotify events, so we can just use those.
bd3c81f
to
3ac6c86
Compare
Pushed a fix for VST2 resizing in Ardour (which made the mouse offset come back on resize until the window is moved once). This sounds similar to the Reaper issue described in #409, so maybe it helps there too? |
Noticed another unrelated bug... the VST3 version of M1 only works when you add it fresh, if you save and reload the project file audio output stops working. Other VST3 plugins (like FabFilter Twin2) work though, and the VST2 version of M1 works too. Not sure if this is an Ardour bug, a plugin bug, or a yabridge bug... |
Plugin-initiated resizing works well with VST2 (tested M1 and FabFilter). Host-initiated resizing is broken though. Conversely, host-initiated works for VST3 and not plugin-initiated in Ardour. The latter I think is just Ardour brokenness, but let me see if I can fix the former... |
Looks like that just causes the parent window to be resized, so we have to listen to that and trigger editor resizing. But we need to be careful not to trigger resize loops. Edit: Nope, at least for FabFilter plugins, even if I resize the wrapper + Wine windows, nothing happens. Maybe this is just broken with VST2? Looks like on platforms where it works it's some kind of hack... |
M1 works fine for me on REAPER whether loading it new or from an existing project. |
@DaforLynx I think we can probably call that one an Ardour or plugin bug then, most likely ^^ (you tested VST3, right? VST2 does work on Ardour too) |
Oh, I'm dumb. No, I also used the VST2 XD |
Thanks so much for taking the time to look into this! I poked at this a couple times over the past months but I just haven't had the time to dig deeper. I wish it wasn't so much work to get the behavior to be as good as it was pre-Wine 9.22. 😅 I sadly won't have time to properly take a look at this until at least Wednesday, sorry for that! I quickly checked the behavior with VST2 and VST3 ValhallaSuperMassive. Everything seems to behavior correctly with 1.5x DPI scaling in Bitwig, REAPER is unresponsive, and with |
REAPER user here. VST3 plugins still have the offset problem until I fullscreen the FX window. VST2 plugins also have the same issue except I have to place the plugin's UI on the top left corner of the screen (not maximize it). I thought it was just KORG WAVESTATION and TRITON but I also tested Vallhalla's ValhallaFreqEcho which has both VST2 and VST3 versions and they have the exact same behaviour. I guess the upside is that some plugins that I couldn't render at all before with the main new-wine10-embedding (KORG TRITON for example which would only show a small square) now display fine even if it has those issues lol. Update: Just tested them all in Ardour and they work perfectly there! |
572729b
to
e18d598
Compare
Still haven't gotten around to looking at the remaining issues, but since this is already a big improvement over the current status quo I just cherry picked everything into the |
A bunch of fixes for the new embedding branch: