From: Rémi Bernon rbernon@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57370 --- dlls/winex11.drv/window.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 0c1738c26c6..98772f3d44e 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2474,6 +2474,7 @@ BOOL X11DRV_SystrayDockInsert( HWND hwnd, UINT cx, UINT cy, void *icon ) window = data->whole_window; release_win_data( data );
+ NtUserSetWindowPos( hwnd, NULL, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOZORDER ); NtUserShowWindow( hwnd, SW_SHOWNA );
TRACE_(systray)( "icon window %p/%lx\n", hwnd, window );
From: Rémi Bernon rbernon@codeweavers.com
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; }
From: Rémi Bernon rbernon@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57370 --- dlls/winex11.drv/event.c | 67 +++++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 32 deletions(-)
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 22c15b50274..64c074361fb 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -171,6 +171,40 @@ static inline void free_event_data( XEvent *event ) #endif }
+static void host_window_send_configure_events( struct host_window *win, Display *display, unsigned long serial ) +{ + XConfigureEvent configure = {.type = ConfigureNotify, .serial = serial, .display = display}; + unsigned int i; + + for (i = 0; i < win->children_count; i++) + { + RECT rect = win->children[i].rect; + struct x11drv_win_data *data; + BOOL has_serial; + HWND hwnd; + + /* Only send a fake event if we're not expecting one from a state/config request. + * We may know what was requested, but not what the WM will decide to reply, and our + * fake event might trigger some undesired changes before the real ConfigureNotify. + */ + if (XFindContext( display, win->window, winContext, (char **)&hwnd )) continue; + if (!(data = get_win_data( hwnd ))) continue; + has_serial = data->wm_state_serial || data->configure_serial; + release_win_data( data ); + if (has_serial) continue; + + configure.event = win->children[i].window; + configure.window = configure.event; + configure.x = rect.left; + configure.y = rect.top; + configure.width = rect.right - rect.left; + configure.height = rect.bottom - rect.top; + configure.send_event = 0; + + XPutBackEvent( configure.display, (XEvent *)&configure ); + } +} + static BOOL host_window_filter_event( XEvent *event ) { struct host_window *win; @@ -211,38 +245,7 @@ static BOOL host_window_filter_event( XEvent *event ) }
if (old_rect.left != win->rect.left || old_rect.top != win->rect.top) - { - XConfigureEvent configure = {.type = ConfigureNotify, .serial = event->xany.serial, .display = event->xany.display}; - unsigned int i; - - for (i = 0; i < win->children_count; i++) - { - RECT rect = win->children[i].rect; - struct x11drv_win_data *data; - BOOL has_serial; - HWND hwnd; - - /* Only send a fake event if we're not expecting one from a state/config request. - * We may know what was requested, but not what the WM will decide to reply, and our - * fake event might trigger some undesired changes before the real ConfigureNotify. - */ - if (XFindContext( event->xany.display, event->xany.window, winContext, (char **)&hwnd )) continue; - if (!(data = get_win_data( hwnd ))) continue; - has_serial = data->wm_state_serial || data->configure_serial; - release_win_data( data ); - if (has_serial) continue; - - configure.event = win->children[i].window; - configure.window = configure.event; - configure.x = rect.left; - configure.y = rect.top; - configure.width = rect.right - rect.left; - configure.height = rect.bottom - rect.top; - configure.send_event = 0; - - XPutBackEvent( configure.display, (XEvent *)&configure ); - } - } + host_window_send_configure_events( win, event->xany.display, event->xany.serial );
return TRUE; }
From: Rémi Bernon rbernon@codeweavers.com
Instead of the host window itself, which will never have one.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57370 --- dlls/winex11.drv/event.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 64c074361fb..07ce9a9f1c1 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -183,24 +183,24 @@ static void host_window_send_configure_events( struct host_window *win, Display BOOL has_serial; HWND hwnd;
+ configure.event = win->children[i].window; + configure.window = configure.event; + configure.x = rect.left; + configure.y = rect.top; + configure.width = rect.right - rect.left; + configure.height = rect.bottom - rect.top; + configure.send_event = 0; + /* Only send a fake event if we're not expecting one from a state/config request. * We may know what was requested, but not what the WM will decide to reply, and our * fake event might trigger some undesired changes before the real ConfigureNotify. */ - if (XFindContext( display, win->window, winContext, (char **)&hwnd )) continue; + if (XFindContext( configure.display, configure.window, winContext, (char **)&hwnd )) continue; if (!(data = get_win_data( hwnd ))) continue; has_serial = data->wm_state_serial || data->configure_serial; release_win_data( data ); if (has_serial) continue;
- configure.event = win->children[i].window; - configure.window = configure.event; - configure.x = rect.left; - configure.y = rect.top; - configure.width = rect.right - rect.left; - configure.height = rect.bottom - rect.top; - configure.send_event = 0; - XPutBackEvent( configure.display, (XEvent *)&configure ); } }
From: Rémi Bernon rbernon@codeweavers.com
When an ancestor window is moved.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57370 --- dlls/winex11.drv/event.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 07ce9a9f1c1..8d9a1dd2a70 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -180,7 +180,6 @@ static void host_window_send_configure_events( struct host_window *win, Display { RECT rect = win->children[i].rect; struct x11drv_win_data *data; - BOOL has_serial; HWND hwnd;
configure.event = win->children[i].window; @@ -195,11 +194,13 @@ static void host_window_send_configure_events( struct host_window *win, Display * We may know what was requested, but not what the WM will decide to reply, and our * fake event might trigger some undesired changes before the real ConfigureNotify. */ - if (XFindContext( configure.display, configure.window, winContext, (char **)&hwnd )) continue; - if (!(data = get_win_data( hwnd ))) continue; - has_serial = data->wm_state_serial || data->configure_serial; - release_win_data( data ); - if (has_serial) continue; + if (!XFindContext( configure.display, configure.window, winContext, (char **)&hwnd ) && + (data = get_win_data( hwnd ))) + { + BOOL has_serial = data->wm_state_serial || data->configure_serial; + release_win_data( data ); + if (has_serial) continue; + }
XPutBackEvent( configure.display, (XEvent *)&configure ); }
From: Rémi Bernon rbernon@codeweavers.com
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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 8d9a1dd2a70..dec80c34631 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; }
From: Rémi Bernon rbernon@codeweavers.com
An ancestor might have moved and we want to update any Win32 children window absolute position accordingly.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57370 --- dlls/winex11.drv/event.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index dec80c34631..d8f68689b31 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -210,10 +210,8 @@ static void host_window_send_configure_events( struct host_window *win, Display static BOOL host_window_filter_event( XEvent *event ) { 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) { @@ -234,6 +232,7 @@ static BOOL host_window_filter_event( XEvent *event ) 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 ); break; } case ConfigureNotify: @@ -242,13 +241,11 @@ static BOOL host_window_filter_event( XEvent *event ) 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 ); 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 ); - return TRUE; }
Looks like this breaks some tests...