Skip to content

Commit be52c36

Browse files
committed
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.
1 parent 9916782 commit be52c36

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/wine-host/editor.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,10 +391,14 @@ void Editor::resize(uint16_t width, uint16_t height) {
391391
const std::array<uint32_t, 2> values{width, height};
392392
xcb_configure_window(x11_connection_.get(), wrapper_window_.window_,
393393
value_mask, values.data());
394-
xcb_configure_window(x11_connection_.get(), wine_window_, value_mask,
395-
values.data());
396394
xcb_flush(x11_connection_.get());
397395

396+
// This will trigger the `XCB_CONFIGURE_REQUEST` handler in
397+
// `handle_x11_events()`
398+
SetWindowPos(
399+
win32_window_.handle_, nullptr, 0, 0, width, height,
400+
SWP_NOREPOSITION | SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_DEFERERASE);
401+
398402
// NOTE: This lets us skip resize requests in CLAP plugins when the plugin
399403
// tries to resize to its current size. This fixes resize loops when
400404
// using the CLAP JUCE Extensions.

0 commit comments

Comments
 (0)