From: Gabriel Ivăncescu <gabrielopcode@gmail.com> When the window is created unmapped (on X11 side), and receives focus which is set correctly on the win32 side, it can receive a NET_ACTIVE_WINDOW before it is mapped. This leads to set_net_active_window being skipped with the WARN, even though we set the pending_state to the window. Later when it is mapped, set_net_active_window will return early because of pending_state's net_active_window being set to the same window, even though we actually skipped it. Fixes a regression starting with 0dc7e4046836595335cd64c92cc132791d78fba4 (although it's not fixed by reverting its logic now). Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com> --- dlls/winex11.drv/window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index a9f6dd08276..26cb17a2c77 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2056,7 +2056,6 @@ void set_net_active_window( HWND hwnd, HWND previous ) xev.xclient.data.l[3] = 0; xev.xclient.data.l[4] = 0; - data->pending_state.net_active_window = window; data->net_active_window_serial = NextRequest( data->display ); if (withdrawn) @@ -2066,6 +2065,7 @@ void set_net_active_window( HWND hwnd, HWND previous ) XNoOp( data->display ); return; } + data->pending_state.net_active_window = window; TRACE( "requesting _NET_ACTIVE_WINDOW %p/%lx serial %lu\n", hwnd, window, data->net_active_window_serial ); XSendEvent( data->display, DefaultRootWindow( data->display ), False, -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10133