Skip to content

Commit

Permalink
WIP: Attempt to fix rare multiple displays issue
Browse files Browse the repository at this point in the history
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
  • Loading branch information
robbert-vdh committed Jun 15, 2021
1 parent efeb8d7 commit 5e30c94
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions src/wine-host/editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,21 @@ Editor::Editor(MainContext& main_context,
reinterpret_cast<LPCSTR>(get_window_class()),
"yabridge plugin",
WS_POPUP,
CW_USEDEFAULT,
CW_USEDEFAULT,
// NOTE: With certain DEs/WMs (notably,
// 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.height,
nullptr,
Expand Down Expand Up @@ -338,9 +351,9 @@ Editor::Editor(MainContext& main_context,
main_context, x11_connection,
CreateWindowEx(WS_EX_TOOLWINDOW,
reinterpret_cast<LPCSTR>(get_window_class()),
"yabridge plugin child", WS_CHILD, CW_USEDEFAULT,
CW_USEDEFAULT, client_area.width,
client_area.height, win32_window.handle, nullptr,
"yabridge plugin child", WS_CHILD, 0, 0,
client_area.width, client_area.height,
win32_window.handle, nullptr,
GetModuleHandle(nullptr), this));

ShowWindow(win32_child_window->handle, SW_SHOWNORMAL);
Expand Down

0 comments on commit 5e30c94

Please sign in to comment.