Module: wine Branch: master Commit: b831dbfc3bae2775dda3603c8c42f9ecbc94f2ea URL: https://gitlab.winehq.org/wine/wine/-/commit/b831dbfc3bae2775dda3603c8c42f9e...
Author: Rémi Bernon rbernon@codeweavers.com Date: Fri Oct 13 13:34:32 2023 +0200
winex11: Forcefully unmap the clipping window when it loses focus.
Fixes cursor not being released when alt-tabbing out of an unresponsive foreground window.
---
dlls/winex11.drv/event.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index c3c8d9a4070..053c0e2ff47 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -843,7 +843,13 @@ static BOOL X11DRV_FocusOut( HWND hwnd, XEvent *xev )
if (event->detail == NotifyPointer) { - if (!hwnd && event->window == x11drv_thread_data()->clip_window) NtUserClipCursor( NULL ); + if (!hwnd && event->window == x11drv_thread_data()->clip_window) + { + NtUserClipCursor( NULL ); + /* NtUserClipCursor will ask the foreground window to ungrab the cursor, but + * it might not be responsive, so unmap the clipping window ourselves too */ + XUnmapWindow( event->display, event->window ); + } return TRUE; } if (!hwnd) return FALSE;