From eb8bf93f24dddadcc4ec9d3c99c565134bd9f915 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sat, 1 Mar 2025 19:41:15 +0100 Subject: [PATCH] Resize the Wine window using SetWindowPos This seems to behave more reliably than resizing the window with `xcb_configure_window()`, solving some of the client area issues with Wine 9.21. --- src/wine-host/editor.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/wine-host/editor.cpp b/src/wine-host/editor.cpp index de895dbb..7666e51c 100644 --- a/src/wine-host/editor.cpp +++ b/src/wine-host/editor.cpp @@ -391,10 +391,14 @@ void Editor::resize(uint16_t width, uint16_t height) { const std::array values{width, height}; xcb_configure_window(x11_connection_.get(), wrapper_window_.window_, value_mask, values.data()); - xcb_configure_window(x11_connection_.get(), wine_window_, value_mask, - values.data()); xcb_flush(x11_connection_.get()); + // This will trigger the `XCB_CONFIGURE_REQUEST` handler in + // `handle_x11_events()` + SetWindowPos( + win32_window_.handle_, nullptr, 0, 0, width, height, + SWP_NOREPOSITION | SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_DEFERERASE); + // NOTE: This lets us skip resize requests in CLAP plugins when the plugin // tries to resize to its current size. This fixes resize loops when // using the CLAP JUCE Extensions.