Commit f1f223d0 authored by Alexandre Julliard's avatar Alexandre Julliard

winex11: Release the clip cursor grab when the clipping window loses focus.

parent fa2e4bb5
......@@ -258,7 +258,7 @@ void X11DRV_resize_desktop( unsigned int width, unsigned int height )
virtual_screen_rect.right - virtual_screen_rect.left,
virtual_screen_rect.bottom - virtual_screen_rect.top,
SWP_NOZORDER | SWP_NOACTIVATE | SWP_DEFERERASE );
X11DRV_ClipCursor( NULL );
ungrab_clipping_window();
SendMessageTimeoutW( HWND_BROADCAST, WM_DISPLAYCHANGE, screen_bpp,
MAKELPARAM( width, height ), SMTO_ABORTIFHUNG, 2000, NULL );
}
......
......@@ -672,7 +672,16 @@ static void X11DRV_FocusOut( HWND hwnd, XEvent *xev )
int revert;
XIC xic;
if (!hwnd) return;
if (!hwnd)
{
if (event->detail == NotifyPointer && event->window == x11drv_thread_data()->clip_window)
{
TRACE( "clip window lost focus\n" );
ungrab_clipping_window();
ClipCursor( NULL ); /* make sure the clip rectangle is reset too */
}
return;
}
TRACE( "win %p xwin %lx detail=%s\n", hwnd, event->window, focus_details[event->detail] );
......
......@@ -447,7 +447,7 @@ static BOOL grab_clipping_window( const RECT *clip )
*
* Release the pointer grab on the clip window.
*/
static void ungrab_clipping_window(void)
void ungrab_clipping_window(void)
{
Display *display = thread_init_display();
Window clip_window = init_clip_window();
......
......@@ -2002,7 +2002,7 @@ BOOL CDECL X11DRV_CreateWindow( HWND hwnd )
/* create the cursor clipping window */
attr.override_redirect = TRUE;
attr.event_mask = StructureNotifyMask;
attr.event_mask = StructureNotifyMask | FocusChangeMask;
wine_tsx11_lock();
data->clip_window = XCreateWindow( data->display, root_window, 0, 0, 1, 1, 0, 0,
InputOnly, visual, CWOverrideRedirect | CWEventMask, &attr );
......
......@@ -829,7 +829,7 @@ extern void CDECL X11DRV_SetFocus( HWND hwnd );
extern void set_window_cursor( Window window, HCURSOR handle );
extern void sync_window_cursor( Window window );
extern LRESULT clip_cursor_notify( HWND hwnd, HWND new_clip_hwnd );
extern BOOL CDECL X11DRV_ClipCursor( LPCRECT clip );
extern void ungrab_clipping_window(void);
extern void X11DRV_InitKeyboard( Display *display );
extern DWORD CDECL X11DRV_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles, DWORD timeout,
DWORD mask, DWORD flags );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment