Skip to content

Commit 1950206

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 9b1f3a5 commit 1950206

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
@@ -209,8 +209,21 @@ Editor::Editor(MainContext& main_context,
209209
reinterpret_cast<LPCSTR>(get_window_class()),
210210
"yabridge plugin",
211211
WS_POPUP,
212-
CW_USEDEFAULT,
213-
CW_USEDEFAULT,
212+
// NOTE: With certain DEs/WMs (notably,
213+
// Cinnamon), Wine does not render the
214+
// window at all when using a primary
215+
// display that's positioned to the
216+
// right of another display. Presumably
217+
// it tries to manually clip the client
218+
// rendered client area to the physical
219+
// display. During the reparenting and
220+
// `fix_local_coordinates()` the window
221+
// will be moved to `(0, 0)` anyways,
222+
// but setting its initial position
223+
// according to the primary display
224+
// fixes these rendering issues.
225+
GetSystemMetrics(SM_XVIRTUALSCREEN),
226+
GetSystemMetrics(SM_YVIRTUALSCREEN),
214227
client_area.width,
215228
client_area.height,
216229
nullptr,
@@ -341,9 +354,9 @@ Editor::Editor(MainContext& main_context,
341354
main_context, x11_connection,
342355
CreateWindowEx(WS_EX_TOOLWINDOW,
343356
reinterpret_cast<LPCSTR>(get_window_class()),
344-
"yabridge plugin child", WS_CHILD, CW_USEDEFAULT,
345-
CW_USEDEFAULT, client_area.width,
346-
client_area.height, win32_window.handle, nullptr,
357+
"yabridge plugin child", WS_CHILD, 0, 0,
358+
client_area.width, client_area.height,
359+
win32_window.handle, nullptr,
347360
GetModuleHandle(nullptr), this));
348361

349362
ShowWindow(win32_child_window->handle, SW_SHOWNORMAL);

0 commit comments

Comments
 (0)