From ab40b7fd8686345bf77a27ceb12d4dfbaa753829 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 13 Nov 2024 15:52:41 +0100 Subject: [PATCH] winex11: Always generate ConfigureNotify events for embedded windows. We won't receive a ConfigureNotify event if the embedded window has been reparented without moving or resizing it. Top-level windows always receive synthetic ConfigureNotify from the window manager. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57370 --- dlls/winex11.drv/event.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index c0e19fee093..5300982d6b2 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -197,7 +197,8 @@ static void host_window_send_configure_events( struct host_window *win, Display if (!XFindContext( configure.display, configure.window, winContext, (char **)&hwnd ) && (data = get_win_data( hwnd ))) { - BOOL has_serial = data->wm_state_serial || data->configure_serial; + /* embedded windows won't receive synthetic ConfigureNotify and are positioned by the WM */ + BOOL has_serial = !data->embedded && (data->wm_state_serial || data->configure_serial); release_win_data( data ); if (has_serial) continue; } @@ -211,10 +212,8 @@ static void host_window_send_configure_events( struct host_window *win, Display static BOOL host_window_filter_event( XEvent *event, XEvent *previous ) { struct host_window *win; - RECT old_rect; if (!(win = get_host_window( event->xany.window, FALSE ))) return FALSE; - old_rect = win->rect; switch (event->type) { @@ -227,6 +226,7 @@ static BOOL host_window_filter_event( XEvent *event, XEvent *previous ) XReparentEvent *reparent = (XReparentEvent *)event; TRACE( "host window %p/%lx ReparentNotify, parent %lx\n", win, win->window, reparent->parent ); host_window_set_parent( win, reparent->parent ); + host_window_send_configure_events( win, event->xany.display, event->xany.serial, previous ); break; } case GravityNotify: @@ -235,6 +235,7 @@ static BOOL host_window_filter_event( XEvent *event, XEvent *previous ) OffsetRect( &win->rect, gravity->x - win->rect.left, gravity->y - win->rect.top ); if (win->parent) win->rect = host_window_configure_child( win->parent, win->window, win->rect, FALSE ); TRACE( "host window %p/%lx GravityNotify, rect %s\n", win, win->window, wine_dbgstr_rect(&win->rect) ); + host_window_send_configure_events( win, event->xany.display, event->xany.serial, previous ); break; } case ConfigureNotify: @@ -243,13 +244,11 @@ static BOOL host_window_filter_event( XEvent *event, XEvent *previous ) SetRect( &win->rect, configure->x, configure->y, configure->x + configure->width, configure->y + configure->height ); if (win->parent) win->rect = host_window_configure_child( win->parent, win->window, win->rect, configure->send_event ); TRACE( "host window %p/%lx ConfigureNotify, rect %s\n", win, win->window, wine_dbgstr_rect(&win->rect) ); + host_window_send_configure_events( win, event->xany.display, event->xany.serial, previous ); break; } } - if (old_rect.left != win->rect.left || old_rect.top != win->rect.top) - host_window_send_configure_events( win, event->xany.display, event->xany.serial, previous ); - return TRUE; }