xserver: Branch 'mpx' - 3 commits

Peter Hutterer whot at kemper.freedesktop.org
Tue Nov 6 17:59:47 PST 2007


 dix/devices.c |   10 +++++-----
 dix/events.c  |   16 ++++++++++++----
 2 files changed, 17 insertions(+), 9 deletions(-)

New commits:
commit b7ee005d327372c1e414ee6c526f9f7aee14bc86
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Wed Oct 24 10:26:12 2007 +0930

    dix: Don't interfere grabs the interfering device is of different type.
    
    A pointer device should be able to send events while the client has a core
    grab on a keyboard device, and likewise.

diff --git a/dix/events.c b/dix/events.c
index 7a21af1..2032b42 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -6206,7 +6206,9 @@ IsInterferingGrab(ClientPtr client, DeviceIntPtr dev, xEvent* event)
             if (it->deviceGrab.grab && SameClient(it->deviceGrab.grab, client)
                         && !it->deviceGrab.fromPassiveGrab)
             {
-                return TRUE;
+                if ((IsPointerDevice(it) && IsPointerDevice(dev)) ||
+                        (IsKeyboardDevice(it) && IsKeyboardDevice(dev)))
+                    return TRUE;
             }
         }
         it = it->next;
commit 02508614b9f882ba1559fb4581dcf812118fdf89
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Wed Oct 24 10:09:18 2007 +0930

    dix: check for core passive grabs on inferiors when replaying events.

diff --git a/dix/events.c b/dix/events.c
index 8141a40..7a21af1 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -1400,18 +1400,24 @@ ComputeFreezes(void)
                      * deliver it too.
                      * However, we might get here with a core event, in which
                      * case we mustn't emulate a core event.
-                     * XXX: I think this may break things. If a client has a
-                     * device grab, and another client a core grab on an
-                     * inferior window, we never get the core grab. (whot)
                      */
                     sendCore = (replayDev->coreEvents &&
                         (xE->u.u.type & EXTENSION_EVENT_BASE &&
                          XItoCoreType(xE->u.u.type)));
 
+
                     if (sendCore)
                     {
                         core = *xE;
                         core.u.u.type = XItoCoreType(xE->u.u.type);
+                        /* * XXX: Not sure if this is correct: we need to
+                         * check inferior windows for core passive grabs. 
+                         */
+                        if (CheckDeviceGrabs(replayDev, &core, i+1, 1))
+                        {
+                            syncEvents.playingEvents = FALSE;
+                            return;
+                        }
                     }
 		    if (replayDev->focus)
                     {
commit 042e16458b751ad0fcfa1ebbdd74d7d48036b22a
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Tue Oct 9 23:07:51 2007 +0930

    dix: change a few inputInfo.keyboard over to PickKeyboard()

diff --git a/dix/devices.c b/dix/devices.c
index 59404e9..37a98a0 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -1514,7 +1514,7 @@ int
 ProcGetModifierMapping(ClientPtr client)
 {
     xGetModifierMappingReply rep;
-    KeyClassPtr keyc = inputInfo.keyboard->key;
+    KeyClassPtr keyc = PickKeyboard(client)->key;
 
     REQUEST_SIZE_MATCH(xReq);
     rep.type = X_Reply;
@@ -1537,7 +1537,7 @@ ProcChangeKeyboardMapping(ClientPtr client)
     REQUEST(xChangeKeyboardMappingReq);
     unsigned len;
     KeySymsRec keysyms;
-    KeySymsPtr curKeySyms = &inputInfo.keyboard->key->curKeySyms;
+    KeySymsPtr curKeySyms = &PickKeyboard(client)->key->curKeySyms;
     DeviceIntPtr pDev = NULL;
     REQUEST_AT_LEAST_SIZE(xChangeKeyboardMappingReq);
 
@@ -1940,7 +1940,7 @@ int
 ProcGetKeyboardControl (ClientPtr client)
 {
     int i;
-    KeybdCtrl *ctrl = &inputInfo.keyboard->kbdfeed->ctrl;
+    KeybdCtrl *ctrl = &PickKeyboard(client)->kbdfeed->ctrl;
     xGetKeyboardControlReply rep;
 
     REQUEST_SIZE_MATCH(xReq);
@@ -1962,7 +1962,7 @@ ProcGetKeyboardControl (ClientPtr client)
 int
 ProcBell(ClientPtr client)
 {
-    DeviceIntPtr keybd = inputInfo.keyboard;
+    DeviceIntPtr keybd = PickKeyboard(client);
     int base = keybd->kbdfeed->ctrl.bell;
     int newpercent;
     REQUEST(xBellReq);
@@ -2174,7 +2174,7 @@ ProcQueryKeymap(ClientPtr client)
 {
     xQueryKeymapReply rep;
     int i;
-    CARD8 *down = inputInfo.keyboard->key->down;
+    CARD8 *down = PickKeyboard(client)->key->down;
 
     REQUEST_SIZE_MATCH(xReq);
     rep.type = X_Reply;


More information about the xorg-commit mailing list