[PATCH 0/1] MR10817: winex11: Call XSync after XDestroyWindow.
Mainly looking for feedback. When destroying an active window it sometimes happens that X11 sends a PropertyNotify with _NET_ACTIVE_WINDOW set to the destroyed window. This causes Wine to set the active window to the desktop because _NET_ACTIVE_WINDOW is set to a non-wine window (however it's a destroyed wine window that has not been completely destroyed in X11 side) when it should set it to the previous process window. I wrote a test that reproduces this https://gitlab.winehq.org/tati/draft-tests/-/blob/master/app_activation_when... In Windows the program never exits because when destroying the second window it activates the first window. In Wine it sometimes exits because it changes the active window to the desktop for a moment, so WM_ACTIVATEAPP is sent with wparam of 0. Because this bug isn't consistent, I was not able to write a Wine test. I am not entirely sure if calling XSync is a good solution, so I would like to get some feedback on this. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10817
From: Santino Mazza <smazza@codeweavers.com> --- 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 d2d53a40be3..e3127680c9c 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2629,6 +2629,7 @@ void X11DRV_DestroyWindow( HWND hwnd ) if (data->icon_mask) XFreePixmap( gdi_display, data->icon_mask ); if (data->parent) host_window_release( data->parent ); free( data->icon_bits ); + XSync(data->display, TRUE); XDeleteContext( gdi_display, (XID)hwnd, win_data_context ); release_win_data( data ); free( data ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10817
XSync only guarantees synchronization with the server, it can't be used to synchronize with the window manager. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10817#note_139882
participants (3)
-
Alexandre Julliard (@julliard) -
Santino Mazza -
Santino Mazza (@tati)