Skip to content

Commit 5e30c94

Browse files
committed
WIP: Attempt to fix rare multiple displays issue
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 efeb8d7 commit 5e30c94

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

src/wine-host/editor.cpp

+18-5
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,21 @@ Editor::Editor(MainContext& main_context,
207207
reinterpret_cast<LPCSTR>(get_window_class()),
208208
"yabridge plugin",
209209
WS_POPUP,
210-
CW_USEDEFAULT,
211-
CW_USEDEFAULT,
210+
// NOTE: With certain DEs/WMs (notably,
211+
// Cinnamon), Wine does not render the
212+
// window at all when using a primary
213+
// display that's positioned to the
214+
// right of another display. Presumably
215+
// it tries to manually clip the client
216+
// rendered client area to the physical
217+
// display. During the reparenting and
218+
// `fix_local_coordinates()` the window
219+
// will be moved to `(0, 0)` anyways,
220+
// but setting its initial position
221+
// according to the primary display
222+
// fixes these rendering issues.
223+
GetSystemMetrics(SM_XVIRTUALSCREEN),
224+
GetSystemMetrics(SM_YVIRTUALSCREEN),
212225
client_area.width,
213226
client_area.height,
214227
nullptr,
@@ -338,9 +351,9 @@ Editor::Editor(MainContext& main_context,
338351
main_context, x11_connection,
339352
CreateWindowEx(WS_EX_TOOLWINDOW,
340353
reinterpret_cast<LPCSTR>(get_window_class()),
341-
"yabridge plugin child", WS_CHILD, CW_USEDEFAULT,
342-
CW_USEDEFAULT, client_area.width,
343-
client_area.height, win32_window.handle, nullptr,
354+
"yabridge plugin child", WS_CHILD, 0, 0,
355+
client_area.width, client_area.height,
356+
win32_window.handle, nullptr,
344357
GetModuleHandle(nullptr), this));
345358

346359
ShowWindow(win32_child_window->handle, SW_SHOWNORMAL);

0 commit comments

Comments
 (0)