mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 12:10:09 +02:00
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:
@@ -257,8 +257,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,
|
||||
@@ -372,9 +385,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);
|
||||
|
||||
Reference in New Issue
Block a user