Attempt to fix rare multiple displays issue

(cherry picked from 1950206159fbc830718803fa152b636b2a914a95)

Under certain DEs/WMs, the window might not render at all when using
multiple displays and the primary display is set to the rightmost
display.

This seems like a reasonably candidate for fixing this.

https://github.com/robbert-vdh/yabridge/issues/89
https://github.com/robbert-vdh/yabridge/issues/104
This commit is contained in:
Robbert van der Helm
2021-06-15 13:16:50 +02:00
parent 8fbc13fc25
commit f2ffb68b55
2 changed files with 25 additions and 5 deletions
+7
View File
@@ -35,6 +35,13 @@ Versioning](https://semver.org/spec/v2.0.0.html).
yabridge will now try to steal it back and reparent it to the host's window yabridge will now try to steal it back and reparent it to the host's window
again. This very rarely happened with some window managers, like XFWM, and again. This very rarely happened with some window managers, like XFWM, and
only in certain DAWs like **Ardour**. only in certain DAWs like **Ardour**.
- Possibly fixed an obscure error where the editor would not render when using
multiple displays, and the rightmost display was set as primary. This issue is
very rare, and I haven't gotten any response back when I asked the people
affected by this to test a potential fix, so I'm just including it in yabridge
proper in case it helps (it should at least not make anything worse). If
anyone was affected by this, please let me know if this patch makes any
difference!
- Worked around a **REAPER** bug that would cause REAPER to not process any - Worked around a **REAPER** bug that would cause REAPER to not process any
keyboard input when the FX window is active but the mouse is outside of the keyboard input when the FX window is active but the mouse is outside of the
window. We now use the same validation used in `xprop` and `xwininfo` to find window. We now use the same validation used in `xprop` and `xwininfo` to find
+18 -5
View File
@@ -257,8 +257,21 @@ Editor::Editor(MainContext& main_context,
reinterpret_cast<LPCSTR>(get_window_class()), reinterpret_cast<LPCSTR>(get_window_class()),
"yabridge plugin", "yabridge plugin",
WS_POPUP, WS_POPUP,
CW_USEDEFAULT, // NOTE: With certain DEs/WMs (notably,
CW_USEDEFAULT, // Cinnamon), Wine does not render the
// window at all when using a primary
// display that's positioned to the
// right of another display. Presumably
// it tries to manually clip the client
// rendered client area to the physical
// display. During the reparenting and
// `fix_local_coordinates()` the window
// will be moved to `(0, 0)` anyways,
// but setting its initial position
// according to the primary display
// fixes these rendering issues.
GetSystemMetrics(SM_XVIRTUALSCREEN),
GetSystemMetrics(SM_YVIRTUALSCREEN),
client_area.width, client_area.width,
client_area.height, client_area.height,
nullptr, nullptr,
@@ -372,9 +385,9 @@ Editor::Editor(MainContext& main_context,
main_context, x11_connection, main_context, x11_connection,
CreateWindowEx(WS_EX_TOOLWINDOW, CreateWindowEx(WS_EX_TOOLWINDOW,
reinterpret_cast<LPCSTR>(get_window_class()), reinterpret_cast<LPCSTR>(get_window_class()),
"yabridge plugin child", WS_CHILD, CW_USEDEFAULT, "yabridge plugin child", WS_CHILD, 0, 0,
CW_USEDEFAULT, client_area.width, client_area.width, client_area.height,
client_area.height, win32_window.handle, nullptr, win32_window.handle, nullptr,
GetModuleHandle(nullptr), this)); GetModuleHandle(nullptr), this));
ShowWindow(win32_child_window->handle, SW_SHOWNORMAL); ShowWindow(win32_child_window->handle, SW_SHOWNORMAL);