[PATCH v4 2/8] Revert "winex11.drv: Only grab or warp the cursor when keyboard isn't grabbed."

Rémi Bernon rbernon at codeweavers.com
Mon Oct 21 02:13:40 CDT 2019


This reverts commit 54f8077c41f715cfcf9c2bc016d964b720911326.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
 dlls/winex11.drv/event.c  | 11 -----------
 dlls/winex11.drv/mouse.c  | 12 ------------
 dlls/winex11.drv/x11drv.h |  1 -
 3 files changed, 24 deletions(-)

diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c
index 6df5b9bcb2d..ae6860f372e 100644
--- a/dlls/winex11.drv/event.c
+++ b/dlls/winex11.drv/event.c
@@ -155,9 +155,6 @@ static const char * event_names[MAX_EVENT_HANDLERS] =
     "SelectionNotify", "ColormapNotify", "ClientMessage", "MappingNotify", "GenericEvent"
 };
 
-/* is someone else grabbing the keyboard, for example the WM, when manipulating the window */
-BOOL keyboard_grabbed = FALSE;
-
 int xinput2_opcode = 0;
 
 /* return the name of an X event */
@@ -779,16 +776,12 @@ static BOOL X11DRV_FocusIn( HWND hwnd, XEvent *xev )
     {
     case NotifyGrab:
         /* these are received when moving undecorated managed windows on mutter */
-        keyboard_grabbed = TRUE;
         return FALSE;
     case NotifyWhileGrabbed:
-        keyboard_grabbed = TRUE;
         break;
     case NotifyNormal:
-        keyboard_grabbed = FALSE;
         break;
     case NotifyUngrab:
-        keyboard_grabbed = FALSE;
         return TRUE; /* ignore wm specific NotifyUngrab / NotifyGrab events w.r.t focus */
     }
 
@@ -880,16 +873,12 @@ static BOOL X11DRV_FocusOut( HWND hwnd, XEvent *xev )
     {
     case NotifyUngrab:
         /* these are received when moving undecorated managed windows on mutter */
-        keyboard_grabbed = FALSE;
         return FALSE;
     case NotifyNormal:
-        keyboard_grabbed = FALSE;
         break;
     case NotifyWhileGrabbed:
-        keyboard_grabbed = TRUE;
         break;
     case NotifyGrab:
-        keyboard_grabbed = TRUE;
         return TRUE; /* ignore wm specific NotifyUngrab / NotifyGrab events w.r.t focus */
     }
 
diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c
index 4411382d3f1..8f3118e04eb 100644
--- a/dlls/winex11.drv/mouse.c
+++ b/dlls/winex11.drv/mouse.c
@@ -392,12 +392,6 @@ static BOOL grab_clipping_window( const RECT *clip )
                                     GetModuleHandleW(0), NULL )))
         return TRUE;
 
-    if (keyboard_grabbed)
-    {
-        WARN( "refusing to clip to %s\n", wine_dbgstr_rect(clip) );
-        return FALSE;
-    }
-
     /* enable XInput2 unless we are already clipping */
     if (!data->clip_hwnd) enable_xinput2();
 
@@ -1445,12 +1439,6 @@ BOOL CDECL X11DRV_SetCursorPos( INT x, INT y )
     struct x11drv_thread_data *data = x11drv_init_thread_data();
     POINT pos = virtual_screen_to_root( x, y );
 
-    if (keyboard_grabbed)
-    {
-        WARN( "refusing to warp to %u, %u\n", pos.x, pos.y );
-        return FALSE;
-    }
-
     if (!clipping_cursor &&
         XGrabPointer( data->display, root_window, False,
                       PointerMotionMask | ButtonPressMask | ButtonReleaseMask,
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index 607ff474e2a..b0c79e37bb2 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -382,7 +382,6 @@ extern Colormap default_colormap DECLSPEC_HIDDEN;
 extern XPixmapFormatValues **pixmap_formats DECLSPEC_HIDDEN;
 extern Window root_window DECLSPEC_HIDDEN;
 extern BOOL clipping_cursor DECLSPEC_HIDDEN;
-extern BOOL keyboard_grabbed DECLSPEC_HIDDEN;
 extern unsigned int screen_bpp DECLSPEC_HIDDEN;
 extern BOOL use_xkb DECLSPEC_HIDDEN;
 extern BOOL usexrandr DECLSPEC_HIDDEN;
-- 
2.23.0




More information about the wine-devel mailing list