diff --git a/CHANGELOG.md b/CHANGELOG.md index 1266dc10..77403c00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,14 @@ Versioning](https://semver.org/spec/v2.0.0.html). - Added more tracing for input focus handling when using the `+editor` `YABRIDGE_DEBUG_LEVEL` flag. +### Fixed + +- Changed the filter in the Wine->X11 drag-and-drop implementation for + distinguishing between Wine windows and other windows (so that we don't + interfere with Wine->Wine drag-and-drop) to be more specific. Before this + change we might use our own XDND implementation when dragging from a plugin to + a standalone Wine application running within the same Wine prefix. + ## [3.5.0] - 2021-06-23 ### Added diff --git a/src/wine-host/editor.cpp b/src/wine-host/editor.cpp index df322e78..707072e9 100644 --- a/src/wine-host/editor.cpp +++ b/src/wine-host/editor.cpp @@ -44,7 +44,7 @@ using namespace std::literals::string_literals; * The name of the Win32 window class we'll use for the Win32 window that the * plugin can embed itself in. */ -constexpr char window_class_name[] = "yabridge plugin"; +constexpr char yabridge_window_class_name[] = "yabridge plugin"; /** * The Win32 timer ID we'll use to periodically call the VST2 `effeditidle` @@ -1237,7 +1237,7 @@ ATOM get_window_class() noexcept { window_class.lpfnWndProc = window_proc; window_class.hInstance = GetModuleHandle(nullptr); window_class.hCursor = arrow_cursor; - window_class.lpszClassName = window_class_name; + window_class.lpszClassName = yabridge_window_class_name; window_class_handle = RegisterClassEx(&window_class); } @@ -1252,19 +1252,18 @@ bool is_cursor_in_wine_window() noexcept { GetCursorPos(&windows_pointer_pos); if (HWND windows_window = WindowFromPoint(windows_pointer_pos); windows_window && windows_window != windows_desktop_window) { - // NOTE: Because resizing reparented Wine windows without XEmbed is - // a bit janky, yabridge creates windows with client areas - // large enough to fit the entire screen, and the plugin then - // embeds its own GUI in a portion of that. The result is that + // NOTE: Because resizing reparented Wine windows without XEmbed is a + // bit janky, yabridge creates windows with client areas large + // enough to fit the entire screen, and the plugin then embeds its + // own GUI in a portion of that. The result is that // `WindowFromPoint()` will still return that same huge window - // when we hover over an area to the right or to the bottom of - // a plugin GUI. We can easily detect and skip that though, - // since the embedded plugin windows won't have an X11 window - // ID property. - const xcb_window_t x11_window = - static_cast(reinterpret_cast( - GetProp(windows_window, "__wine_x11_whole_window"))); - if (x11_window == XCB_NONE) { + // when we hover over an area to the right or to the bottom of a + // plugin GUI. We can easily detect by just checking the window + // class name. + std::array window_class_name{0}; + GetClassName(windows_window, window_class_name.data(), + window_class_name.size()); + if (strcmp(window_class_name.data(), yabridge_window_class_name) != 0) { return true; } }