xserver: Branch 'master' - 6 commits

Keith Packard keithp at kemper.freedesktop.org
Fri Aug 30 05:17:36 PDT 2013


 Xi/grabdev.c          |    5 +----
 Xi/xiallowev.c        |    2 +-
 dix/events.c          |   25 +++++++++++++++++--------
 include/inputstr.h    |    2 +-
 test/signal-logging.c |    3 ++-
 5 files changed, 22 insertions(+), 15 deletions(-)

New commits:
commit 94d4e29aedc69431fa9b299ca1b67947173d7a24
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Aug 26 15:51:46 2013 +1000

    Xi: allow for XIAllowEvent requests larger than XI < 2.2 size (#68554)
    
    XIAllowEvents changed length in XI 2.2 (for the touchid). A bug in libXi
    causes libXi to always use the new request length if the server supports
    2.2, regardless of the client's XIQueryVersion request.
    
    The server takes the client's XIQueryVersion request into account though,
    resulting in a BadLength error if a 2.[0,1] client calls XIAllowEvents on a
    XI 2.2+ server.
    
    Can't fix this in libXi, so work around this in the server.
    
    X.Org Bug 68554 <http://bugs.freedesktop.org/show_bug.cgi?id=68554>
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Adam Jackson <ajax at redhat.com>

diff --git a/Xi/xiallowev.c b/Xi/xiallowev.c
index 62a0727..ebef233 100644
--- a/Xi/xiallowev.c
+++ b/Xi/xiallowev.c
@@ -81,7 +81,7 @@ ProcXIAllowEvents(ClientPtr client)
         have_xi22 = TRUE;
     }
     else {
-        REQUEST_SIZE_MATCH(xXIAllowEventsReq);
+        REQUEST_AT_LEAST_SIZE(xXIAllowEventsReq);
     }
 
     ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
commit 82939e02392cbb880313fe92957091ff89ce2f2b
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Aug 16 15:30:59 2013 +1000

    dix: check for grab type before checking XI2 mask
    
    if the grab type isn't XI2, grab->xi2mask is random. That random data may
    have the enter/leave mask set, leading to events sent to the client that the
    client can't handler.
    
    Source of these errors:
      _xgeWireToEvent: Unknown extension 131, this should never happen.
    
    Simplest reproducer:
       Start Xephyr, press button inside window, move out. As the pointer leaves
       the Xephyr window, the errors appear.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Adam Jackson <ajax at redhat.com>

diff --git a/dix/events.c b/dix/events.c
index 4e6a175..086601a 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -4653,7 +4653,7 @@ DeviceEnterLeaveEvent(DeviceIntPtr mouse,
 
     filter = GetEventFilter(mouse, (xEvent *) event);
 
-    if (grab) {
+    if (grab && grab->type == XI2) {
         Mask mask;
 
         mask = xi2mask_isset(grab->xi2mask, mouse, type);
commit 16894df1ffb6fe21bf723dd954578e8d934799ca
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Aug 16 10:55:09 2013 +1000

    Xi: replace loop with memset
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Adam Jackson <ajax at redhat.com>

diff --git a/Xi/grabdev.c b/Xi/grabdev.c
index 443ef56..9c6c429 100644
--- a/Xi/grabdev.c
+++ b/Xi/grabdev.c
@@ -175,10 +175,7 @@ CreateMaskFromList(ClientPtr client, XEventClass * list, int count,
     int device;
     DeviceIntPtr tdev;
 
-    for (i = 0; i < EMASKSIZE; i++) {
-        mask[i].mask = 0;
-        mask[i].dev = NULL;
-    }
+    memset(mask, 0, EMASKSIZE * sizeof(struct tmask));
 
     for (i = 0; i < count; i++, list++) {
         device = *list >> 8;
commit 8f2292b683f591052da2fe94fb3831a3c9a5aa61
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Aug 16 11:05:49 2013 +1000

    include: wrap EMASKSIZE in parentheses
    
    Otherwise things like EMASKSIZE * foo will yield interesting results.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Adam Jackson <ajax at redhat.com>

diff --git a/include/inputstr.h b/include/inputstr.h
index 2da72c1..dc36c5d 100644
--- a/include/inputstr.h
+++ b/include/inputstr.h
@@ -65,7 +65,7 @@ extern _X_EXPORT int CountBits(const uint8_t * mask, int len);
 #define SameClient(obj,client) \
 	(CLIENT_BITS((obj)->resource) == (client)->clientAsMask)
 
-#define EMASKSIZE	MAXDEVICES + 2
+#define EMASKSIZE	(MAXDEVICES + 2)
 
 /* This is the last XI2 event supported by the server. If you add
  * events to the protocol, the server will not support these events until
commit d803f296c616ccf55711cf0af9e7d3eae2edda16
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Aug 23 09:04:01 2013 +1000

    test: fix the gcc diagnostics pragma
    
    pop without push restores the commandline options. The proper way is to
    push, then ignore, then pop.
    
    And while we're at it, change the pop argument to a comment - pop ignores
    the argument, but be proper about it.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/test/signal-logging.c b/test/signal-logging.c
index f6bc85c..a03c5ac 100644
--- a/test/signal-logging.c
+++ b/test/signal-logging.c
@@ -150,6 +150,7 @@ number_formatting(void)
         assert(check_float_format_test(float_tests[i]));
 }
 
+#pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wformat-security"
 static void logging_format(void)
 {
@@ -378,7 +379,7 @@ static void logging_format(void)
 
 #undef read_log_msg
 }
-#pragma GCC diagnostic pop "-Wformat-security"
+#pragma GCC diagnostic pop /* "-Wformat-security" */
 
 int
 main(int argc, char **argv)
commit 05ea6307fa4f0bee3d3bf536396059f3906791a0
Author: Egbert Eich <eich at freedesktop.org>
Date:   Fri Aug 16 19:52:16 2013 +0200

    DIX/Xi: Pass correct client to CheckDeviceGrabAndHintWindow()
    
    If we have a client which has registered for a DeviceButton grab
    be sure to pass this to CheckDeviceGrabAndHintWindow(). Since the
    order of clients is arbitrary there is no guarantee that the last
    client in the list is the one that belongs to this class.
    
    Signed-off-by: Egbert Eich <eich at freedesktop.org>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/events.c b/dix/events.c
index ed3138d..4e6a175 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -2105,6 +2105,7 @@ DeliverEventToInputClients(DeviceIntPtr dev, InputClients * inputclients,
 {
     int attempt;
     enum EventDeliveryState rc = EVENT_NOT_DELIVERED;
+    Bool have_device_button_grab_class_client = FALSE;
 
     for (; inputclients; inputclients = inputclients->next) {
         Mask mask;
@@ -2124,13 +2125,21 @@ DeliverEventToInputClients(DeviceIntPtr dev, InputClients * inputclients,
                                             events, count,
                                             mask, filter, grab))) {
             if (attempt > 0) {
-                rc = EVENT_DELIVERED;
-                *client_return = client;
-                *mask_return = mask;
-                /* Success overrides non-success, so if we've been
-                 * successful on one client, return that */
-            }
-            else if (rc == EVENT_NOT_DELIVERED)
+                /*
+                 * The order of clients is arbitrary therefore if one
+                 * client belongs to DeviceButtonGrabClass make sure to
+                 * catch it.
+                 */
+                if (!have_device_button_grab_class_client) {
+                    rc = EVENT_DELIVERED;
+                    *client_return = client;
+                    *mask_return = mask;
+                    /* Success overrides non-success, so if we've been
+                     * successful on one client, return that */
+                    if (mask & DeviceButtonGrabMask)
+                        have_device_button_grab_class_client = TRUE;
+                }
+            } else if (rc == EVENT_NOT_DELIVERED)
                 rc = EVENT_REJECTED;
         }
     }


More information about the xorg-commit mailing list