xserver: Branch 'master' - 2 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Mar 30 21:53:28 UTC 2020


 Xi/exevents.c  |   13 ++++++++----
 Xi/exglobals.h |    3 --
 Xi/extinit.c   |   58 ++++-----------------------------------------------------
 Xi/selectev.c  |    4 ---
 4 files changed, 15 insertions(+), 63 deletions(-)

New commits:
commit 5684d436e2b65cd0fe305460e437a2f69af29865
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Apr 19 14:49:22 2018 -0400

    xinput: Remove PropagateMask
    
    Initialized to a constant value, never modified, never varied by device.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/Xi/exevents.c b/Xi/exevents.c
index 659816a46..98319ad4d 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -746,9 +746,8 @@ UpdateDeviceMotionMask(DeviceIntPtr device, unsigned short state,
 {
     Mask mask;
 
-    mask = DevicePointerMotionMask | state | motion_mask;
-    SetMaskForEvent(device->id, mask, DeviceMotionNotify);
     mask = PointerMotionMask | state | motion_mask;
+    SetMaskForEvent(device->id, mask, DeviceMotionNotify);
     SetMaskForEvent(device->id, mask, MotionNotify);
 }
 
@@ -2522,6 +2521,12 @@ FreeInputMask(OtherInputMasks ** imask)
     *imask = NULL;
 }
 
+#define XIPropagateMask (KeyPressMask | \
+                         KeyReleaseMask | \
+                         ButtonPressMask | \
+                         ButtonReleaseMask | \
+                         PointerMotionMask)
+
 void
 RecalculateDeviceDeliverableEvents(WindowPtr pWin)
 {
@@ -2548,7 +2553,7 @@ RecalculateDeviceDeliverableEvents(WindowPtr pWin)
                         inputMasks->deliverableEvents[i] |=
                             (wOtherInputMasks(tmp)->deliverableEvents[i]
                              & ~inputMasks->dontPropagateMask[i] &
-                             PropagateMask[i]);
+                             XIPropagateMask);
         }
         if (pChild->firstChild) {
             pChild = pChild->firstChild;
@@ -2961,7 +2966,7 @@ DeviceEventSuppressForWindow(WindowPtr pWin, ClientPtr client, Mask mask,
 {
     struct _OtherInputMasks *inputMasks = wOtherInputMasks(pWin);
 
-    if (mask & ~PropagateMask[maskndx]) {
+    if (mask & ~XIPropagateMask) {
         client->errorValue = mask;
         return BadValue;
     }
diff --git a/Xi/exglobals.h b/Xi/exglobals.h
index 9f235e034..461a7f8ca 100644
--- a/Xi/exglobals.h
+++ b/Xi/exglobals.h
@@ -44,7 +44,6 @@ extern int DeviceBusy;
 extern int BadClass;
 
 /* Note: only the ones needed in files other than extinit.c are declared */
-extern const Mask DevicePointerMotionMask;
 extern const Mask DevicePointerMotionHintMask;
 extern const Mask DeviceFocusChangeMask;
 extern const Mask DeviceStateNotifyMask;
@@ -56,8 +55,6 @@ extern const Mask DevicePresenceNotifyMask;
 extern const Mask DevicePropertyNotifyMask;
 extern const Mask XIAllMasks;
 
-extern Mask PropagateMask[];
-
 extern int DeviceValuator;
 extern int DeviceKeyPress;
 extern int DeviceKeyRelease;
diff --git a/Xi/extinit.c b/Xi/extinit.c
index ecb55da42..8d9120866 100644
--- a/Xi/extinit.c
+++ b/Xi/extinit.c
@@ -129,13 +129,8 @@ SOFTWARE.
  * breaks down. The device needs the dev->button->motionMask. If DBMM is
  * the same as BMM, we can ensure that both core and device events can be
  * delivered, without the need for extra structures in the DeviceIntRec. */
-const Mask DeviceKeyPressMask = KeyPressMask;
-const Mask DeviceKeyReleaseMask = KeyReleaseMask;
-const Mask DeviceButtonPressMask = ButtonPressMask;
-const Mask DeviceButtonReleaseMask = ButtonReleaseMask;
 const Mask DeviceProximityMask = (1L << 4);
 const Mask DeviceStateNotifyMask = (1L << 5);
-const Mask DevicePointerMotionMask = PointerMotionMask;
 const Mask DevicePointerMotionHintMask = PointerMotionHintMask;
 const Mask DeviceButton1MotionMask = Button1MotionMask;
 const Mask DeviceButton2MotionMask = Button2MotionMask;
@@ -363,8 +358,6 @@ RESTYPE RT_INPUTCLIENT;
 
 extern XExtensionVersion XIVersion;
 
-Mask PropagateMask[EMASKSIZE];
-
 /*****************************************************************
  *
  * Versioning support
@@ -914,22 +907,6 @@ XI2EventSwap(xGenericEvent *from, xGenericEvent *to)
     }
 }
 
-/**************************************************************************
- *
- * Allow the specified event to have its propagation suppressed.
- * The default is to not allow suppression of propagation.
- *
- */
-
-static void
-AllowPropagateSuppress(Mask mask)
-{
-    int i;
-
-    for (i = 0; i < MAXDEVICES; i++)
-        PropagateMask[i] |= mask;
-}
-
 /**************************************************************************
  *
  * Record an event mask where there is no unique corresponding event type.
@@ -1011,20 +988,16 @@ FixExtensionEvents(ExtensionEntry * extEntry)
     DeviceBusy += extEntry->errorBase;
     BadClass += extEntry->errorBase;
 
-    SetMaskForExtEvent(DeviceKeyPressMask, DeviceKeyPress);
-    AllowPropagateSuppress(DeviceKeyPressMask);
+    SetMaskForExtEvent(KeyPressMask, DeviceKeyPress);
     SetCriticalEvent(DeviceKeyPress);
 
-    SetMaskForExtEvent(DeviceKeyReleaseMask, DeviceKeyRelease);
-    AllowPropagateSuppress(DeviceKeyReleaseMask);
+    SetMaskForExtEvent(KeyReleaseMask, DeviceKeyRelease);
     SetCriticalEvent(DeviceKeyRelease);
 
-    SetMaskForExtEvent(DeviceButtonPressMask, DeviceButtonPress);
-    AllowPropagateSuppress(DeviceButtonPressMask);
+    SetMaskForExtEvent(ButtonPressMask, DeviceButtonPress);
     SetCriticalEvent(DeviceButtonPress);
 
-    SetMaskForExtEvent(DeviceButtonReleaseMask, DeviceButtonRelease);
-    AllowPropagateSuppress(DeviceButtonReleaseMask);
+    SetMaskForExtEvent(ButtonReleaseMask, DeviceButtonRelease);
     SetCriticalEvent(DeviceButtonRelease);
 
     SetMaskForExtEvent(DeviceProximityMask, ProximityIn);
@@ -1032,8 +1005,7 @@ FixExtensionEvents(ExtensionEntry * extEntry)
 
     SetMaskForExtEvent(DeviceStateNotifyMask, DeviceStateNotify);
 
-    SetMaskForExtEvent(DevicePointerMotionMask, DeviceMotionNotify);
-    AllowPropagateSuppress(DevicePointerMotionMask);
+    SetMaskForExtEvent(PointerMotionMask, DeviceMotionNotify);
     SetCriticalEvent(DeviceMotionNotify);
 
     SetEventInfo(DevicePointerMotionHintMask, _devicePointerMotionHint);
commit 4520ec9bd54b261fa2b210e9550d76087ef06259
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Apr 19 14:42:47 2018 -0400

    xinput: Remove ExtExclusiveMasks
    
    Initialized to a constant value, never modified, never varied by device.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/Xi/extinit.c b/Xi/extinit.c
index 058218905..ecb55da42 100644
--- a/Xi/extinit.c
+++ b/Xi/extinit.c
@@ -153,7 +153,6 @@ const Mask DevicePropertyNotifyMask = (1L << 19);
 const Mask XIAllMasks = (1L << 20) - 1;
 
 int ExtEventIndex;
-Mask ExtExclusiveMasks[EMASKSIZE];
 
 static struct dev_type {
     Atom type;
@@ -951,23 +950,6 @@ SetEventInfo(Mask mask, int constant)
     EventInfo[ExtEventIndex++].type = constant;
 }
 
-/**************************************************************************
- *
- * Allow the specified event to be restricted to being selected by one
- * client at a time.
- * The default is to allow more than one client to select the event.
- *
- */
-
-static void
-SetExclusiveAccess(Mask mask)
-{
-    int i;
-
-    for (i = 0; i < MAXDEVICES; i++)
-        ExtExclusiveMasks[i] |= mask;
-}
-
 /**************************************************************************
  *
  * Assign the specified mask to the specified event.
@@ -1069,8 +1051,6 @@ FixExtensionEvents(ExtensionEntry * extEntry)
     SetMaskForExtEvent(ChangeDeviceNotifyMask, ChangeDeviceNotify);
 
     SetEventInfo(DeviceButtonGrabMask, _deviceButtonGrab);
-    SetExclusiveAccess(DeviceButtonGrabMask);
-
     SetEventInfo(DeviceOwnerGrabButtonMask, _deviceOwnerGrabButton);
     SetEventInfo(DevicePresenceNotifyMask, _devicePresence);
     SetMaskForExtEvent(DevicePropertyNotifyMask, DevicePropertyNotify);
diff --git a/Xi/selectev.c b/Xi/selectev.c
index b9b8112aa..65c7bc868 100644
--- a/Xi/selectev.c
+++ b/Xi/selectev.c
@@ -65,8 +65,6 @@ SOFTWARE.
 #include "grabdev.h"
 #include "selectev.h"
 
-extern Mask ExtExclusiveMasks[];
-
 static int
 HandleDevicePresenceMask(ClientPtr client, WindowPtr win,
                          XEventClass * cls, CARD16 *count)
@@ -175,7 +173,7 @@ ProcXSelectExtensionEvent(ClientPtr client)
             }
             if ((ret =
                  SelectForWindow((DeviceIntPtr) tmp[i].dev, pWin, client,
-                                 tmp[i].mask, ExtExclusiveMasks[i])) != Success)
+                                 tmp[i].mask, DeviceButtonGrabMask)) != Success)
                 return ret;
         }
 


More information about the xorg-commit mailing list