Skip to content

Commit f2ffb68

Browse files
committed
Attempt to fix rare multiple displays issue
(cherry picked from 1950206) 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. #89 #104
1 parent 8fbc13f commit f2ffb68

File tree

2 files changed

+25
-5
lines changed

2 files changed

+25
-5
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ Versioning](https://semver.org/spec/v2.0.0.html).
3535
yabridge will now try to steal it back and reparent it to the host's window
3636
again. This very rarely happened with some window managers, like XFWM, and
3737
only in certain DAWs like **Ardour**.
38+
- Possibly fixed an obscure error where the editor would not render when using
39+
multiple displays, and the rightmost display was set as primary. This issue is
40+
very rare, and I haven't gotten any response back when I asked the people
41+
affected by this to test a potential fix, so I'm just including it in yabridge
42+
proper in case it helps (it should at least not make anything worse). If
43+
anyone was affected by this, please let me know if this patch makes any
44+
difference!
3845
- Worked around a **REAPER** bug that would cause REAPER to not process any
3946
keyboard input when the FX window is active but the mouse is outside of the
4047
window. We now use the same validation used in `xprop` and `xwininfo` to find

src/wine-host/editor.cpp

+18-5
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,21 @@ Editor::Editor(MainContext& main_context,
257257
reinterpret_cast<LPCSTR>(get_window_class()),
258258
"yabridge plugin",
259259
WS_POPUP,
260-
CW_USEDEFAULT,
261-
CW_USEDEFAULT,
260+
// NOTE: With certain DEs/WMs (notably,
261+
// Cinnamon), Wine does not render the
262+
// window at all when using a primary
263+
// display that's positioned to the
264+
// right of another display. Presumably
265+
// it tries to manually clip the client
266+
// rendered client area to the physical
267+
// display. During the reparenting and
268+
// `fix_local_coordinates()` the window
269+
// will be moved to `(0, 0)` anyways,
270+
// but setting its initial position
271+
// according to the primary display
272+
// fixes these rendering issues.
273+
GetSystemMetrics(SM_XVIRTUALSCREEN),
274+
GetSystemMetrics(SM_YVIRTUALSCREEN),
262275
client_area.width,
263276
client_area.height,
264277
nullptr,
@@ -372,9 +385,9 @@ Editor::Editor(MainContext& main_context,
372385
main_context, x11_connection,
373386
CreateWindowEx(WS_EX_TOOLWINDOW,
374387
reinterpret_cast<LPCSTR>(get_window_class()),
375-
"yabridge plugin child", WS_CHILD, CW_USEDEFAULT,
376-
CW_USEDEFAULT, client_area.width,
377-
client_area.height, win32_window.handle, nullptr,
388+
"yabridge plugin child", WS_CHILD, 0, 0,
389+
client_area.width, client_area.height,
390+
win32_window.handle, nullptr,
378391
GetModuleHandle(nullptr), this));
379392

380393
ShowWindow(win32_child_window->handle, SW_SHOWNORMAL);

0 commit comments

Comments
 (0)