From 9c901935d43a88c2f6552e39c340be7483585b7e Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sat, 23 May 2020 15:09:56 +0200 Subject: [PATCH] Fix editor GUIs for plugin groups Handles for things like timers should be unique on a per-thread basis in the Win32 API, but apparently window classes have to be unique for the entire application. --- src/wine-host/bridges/vst2.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/wine-host/bridges/vst2.cpp b/src/wine-host/bridges/vst2.cpp index c2cde442..737dd249 100644 --- a/src/wine-host/bridges/vst2.cpp +++ b/src/wine-host/bridges/vst2.cpp @@ -361,8 +361,13 @@ intptr_t Vst2Bridge::dispatch_wrapper(AEffect* plugin, // provided by the host, and let the plugin embed itself into // the Wine window const auto x11_handle = reinterpret_cast(data); + // Win32 window classes have to be unique for the whole application. + // When hosting multiple plugins in a group process, all plugins + // should get a unique window class + const std::string window_class = + "yabridge plugin " + socket_endpoint.path(); Editor& editor_instance = - editor.emplace("yabridge plugin", plugin, x11_handle); + editor.emplace(window_class, plugin, x11_handle); return plugin->dispatcher(plugin, opcode, index, value, editor_instance.win32_handle.get(),