From 4eefc0b9a9793e7bc9c72d457a35a0b42012b4a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 31 Oct 2024 11:36:50 +0100 Subject: [PATCH] winex11: Reset the window relative position when it gets reparented. Instead of keeping the same offset as from the previous window parent, which may cause offsets to stack up with embedded windows. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57370 --- dlls/winex11.drv/window.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 98772f3d44e..02a1eb13c48 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2320,7 +2320,12 @@ void set_window_parent( struct x11drv_win_data *data, Window parent ) if (!data->whole_window) return; /* only keep track of parent if we have a toplevel */ TRACE( "window %p/%lx, parent %lx\n", data->hwnd, data->whole_window, parent ); host_window_reparent( &data->parent, parent, data->whole_window ); - if (data->parent) host_window_configure_child( data->parent, data->whole_window, data->rects.visible, TRUE ); + if (data->parent) + { + RECT rect = data->rects.visible; + OffsetRect( &rect, -rect.left, -rect.top ); + host_window_configure_child( data->parent, data->whole_window, rect, TRUE ); + } data->parent_invalid = 0; }