Commit Graph

2031 Commits

Author SHA1 Message Date
Robbert van der Helm 3b350e89a0 Update copyright notices 2026-04-26 16:39:33 +02:00
Juuso Kaitila ba7022df0a Fix some plugins not resizing with their expansion toggles
DMG Audio Compassion has a expand/contract toggle button that adds a new
section below the main GUI. Without SWP_NOMOVE it would most of the time
fail to expand and the parent_window_ would sometimes fail to resize
accordingly if the expansion/contraction succeeded resulting in the GUI
locking up.

SWP_NOOWNERZORDER is the same as SWP_NOREPOSITION so having them both
was redundant.
2026-04-26 16:24:39 +02:00
Juuso Kaitila f504da9e46 VST3: Fix reparenting error when opening certain plugins
Fixes an issue where reparenting fails when the initial size returned by
the plugin is 0x0, i.e., invalid.
2026-04-26 16:24:39 +02:00
Juuso Kaitila 8ec0f8b897 VST3: Fix making plugin windows larger not working in Carla
Fixes making VST3 plugins larger than their original size in Carla. The
plugin would resize but not get drawn past the original window size.
2026-04-26 16:24:39 +02:00
Juuso Kaitila 604375b756 VST3: Fix broken resizing in Ardour
Adds timer_proc lambda for VST3 to check for size mismatches and trigger
a new resize to correct it through eventual consistency.

This is done to workaround an X11 sync issue where the plugin view would
end up smaller or larger than its wrapper window. In Ardour this could
result in the plugin becoming uninteractable.
2026-04-26 16:24:39 +02:00
Juuso Kaitila 945528cd7f Fix cursor offset after moving the plugin window 2026-01-11 20:41:56 +01:00
Jakob Steltner a2be8fcf17 Fix some whitespace 2026-01-11 20:41:56 +01:00
Jakob Steltner 174b25be05 Fix some whitespace 2026-01-11 20:41:56 +01:00
Jakob Steltner 44d047e9e2 Work around wrong offset in plugin windows 2026-01-11 20:41:56 +01:00
Asahi Lina 17a95fdf99 Ignore relative ConfigureNotify events after absolute ones
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.
2025-06-01 22:52:27 +02:00
Asahi Lina 2e1dcb2316 Handle absolute ConfigureNotify events for parent window
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.
2025-06-01 22:52:27 +02:00
Asahi Lina dd36bb3d3b Resize the Wine window as well as the wrapper window
This fixes issues with various plugins such as PG-8X and SCVA.
2025-06-01 22:52:27 +02:00
Asahi Lina 6f65613292 VST3: Create the window with the plugin-returned initial size
Instead of creating the window as 128x128 and then resizing, create it
with the size requested by the plugin. Fixes Korg VST3 plugins.
2025-06-01 22:52:27 +02:00
Asahi Lina b2db9cc0a6 VST3: Add HiDPI scaling hack
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.
2025-06-01 22:52:27 +02:00
Asahi Lina 9994043306 Use WM_WINDOW_ROLE instead of WM_STATE to detect the host window
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]"
2025-06-01 22:51:47 +02:00
Robbert van der Helm e18d598c7e Remove function to get X11 screen size
This is no longer used.
2025-06-01 22:47:54 +02:00
Robbert van der Helm eb8bf93f24 Resize the Wine window using SetWindowPos
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.
2025-06-01 22:47:54 +02:00
Robbert van der Helm 66840d4d16 Remove the editor_coordinate_hack option
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.
2025-06-01 22:47:53 +02:00
Robbert van der Helm 51e4d61004 Remove the editor_xembed option 2025-06-01 22:47:38 +02:00
Robbert van der Helm 0f9eea2558 Drop the SWP_NOCOPYBITS on resize hack
This shouldn't be necessary anymore. It can always be added back later
if there is still flickering.
2025-06-01 22:47:13 +02:00
Robbert van der Helm ccf5402c1c Reformat with clang-format 2025-06-01 22:47:13 +02:00
Robbert van der Helm 983a19169b Don't include xcb_icccm.h
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.
2025-06-01 22:47:13 +02:00
Rémi Bernon 02fb140b19 Remove now unnecessary fix_local_coordinates workaround. 2025-06-01 22:47:13 +02:00
Rémi Bernon 2c6c21409c Fix window wrapping by implementing a minimal ICCCM window manager. 2025-06-01 22:47:13 +02:00
Robbert van der Helm 918d24a16e Update asio wrap to 1.34.2
This fixes a compatibility issue with newer asio versions.
2025-06-01 22:45:53 +02:00
Robbert van der Helm 3a26b3a63d Fix typo 2024-11-27 23:44:04 +01:00
Robbert van der Helm aa5c371c32 Try to load posix spawn addclosefrom_np at runtime
To work around the issue from
https://github.com/robbert-vdh/yabridge/issues/377.
2024-11-27 23:39:37 +01:00
Robbert van der Helm 2ad8aba5e3 Fix DPI scaling in Wine 9.17+ 2024-10-06 16:46:12 +02:00
Robbert van der Helm 8d508dc2fe Fix segfault destroying libdbus connection 2024-04-07 22:49:00 +02:00
Robbert van der Helm 49e696e42f Update the copyright headers
Happy new year!
2024-01-09 19:25:38 +01:00
Robbert van der Helm cb6a1dd0ff Fix yabridge_version() in chainloaders
The function doesn't (and cannot) have the same name as the function
pointer, so `MAYBE_LOAD_FUNCTION()` does the wrong thing here. May as
well just do it manually.
2023-12-10 22:48:34 +01:00
Robbert van der Helm f1a7ad4dcb Implement yabridge_version for all plugin bridges
The host can use this to query the yabridge version in use.
2023-12-10 22:30:52 +01:00
Robbert van der Helm d39d3a68c1 Add the chainloader side of yabridge_version
This can be used by hosts to determine which version of yabridge is in
use.
2023-12-10 22:24:41 +01:00
Robbert van der Helm 204e2a6aa1 Fix regression in socket path generation
The latest master branch version would log parsing errors, but that
results in cyclic dependencies. `info_` here would end up being used
before its initialized, which meant that the socket base directory and
thus the logging path would not include the plugin's name.
2023-11-26 14:15:07 +01:00
Robbert van der Helm fa2b348fc2 Run effVendorSpecific on the main thread
This should fix a freeze in Renoise.
2023-11-25 13:49:12 +01:00
Robbert van der Helm f67a170a88 Update the CLAP dependency to version 1.1.9 2023-10-28 16:31:55 +02:00
Robbert van der Helm 4854f8ec3f Make yabridge.toml parsing failures non-fatal 2023-10-28 15:07:53 +02:00
Robbert van der Helm d7d7df575f Move toml++ initialization to its own header 2023-10-28 15:06:59 +02:00
Robbert van der Helm 3af48be58a Revert SWP_NOCOPYBITS removal from 9fd6603ce3
This was added on the request of Aurora FM's developer because they use
thousands of child windows for rendering, but this causes unnecessary
flickering in some situations and it should no longer be as needed now
that `fix_local_coordinates()` is only called once when moving windows
around.
2023-05-07 12:47:20 +02:00
Robbert van der Helm 6c0979c506 Also cache CLAP parameter infos 2023-05-06 22:42:46 +02:00
Robbert van der Helm 135ea8e9c4 Simplify VST3 parameter caching 2023-05-06 22:26:25 +02:00
Robbert van der Helm 8289d76818 Batch VST3 parameter info querying #236
To hopefully work mitigate the Kontakt bug that causes the host to
rescan thousands of parameters hundreds of times when using certain VST3
Kontakt patches in REAPER.
2023-04-28 19:25:04 +02:00
Robbert van der Helm 9005474ded Spool fix_local_coordinates() call until release
This will cause the function to only be called on a `ConfigureNotify`
after all mouse buttons have been released. This prevents flickering
when dragging windows around.
2023-04-28 15:27:02 +02:00
Robbert van der Helm b8a115f655 Clarify X11 error message printing
This simply ignores the error and moves on.
2023-04-28 14:57:25 +02:00
Robbert van der Helm cf48929058 Remove old todo 2023-04-20 16:45:31 +02:00
Robbert van der Helm 3b213605e0 Allow more main thread mutual recursion in CLAP
This is also needed to fix that McRocklin Suite plugin. It changes its
latency during the init call.
2023-04-20 15:48:50 +02:00
Robbert van der Helm ead4ca97c5 Fix race condition in CLAP request callback impl
This would deadlock if the host simultaneously tries to create a plugin
instance.
2023-04-20 15:38:28 +02:00
Robbert van der Helm 265ab1487b Catch negative indices in IParamValueQueue impl
This would cause crashes with the validator which created empty
parameter queues, and many plugins try to `getPoint(numPoints() - 1)`.
2023-04-14 03:28:13 +02:00
Robbert van der Helm fc8359fafb Fix missing line break in initialization message 2023-03-26 15:30:28 +02:00
Robbert van der Helm a35cd8da50 Preemptively unset WAYLAND_DISPLAY 2023-02-25 15:22:23 +01:00