xserver: Branch 'master' - 2 commits

Peter Hutterer whot at kemper.freedesktop.org
Sun Jun 15 03:08:10 PDT 2008


 Xi/exevents.c     |   13 +++++++++----
 dix/getevents.c   |    2 +-
 randr/rrpointer.c |    5 +----
 3 files changed, 11 insertions(+), 9 deletions(-)

New commits:
commit 8c9234a163eceda2abc0a2523e0f5587ea399935
Author: Keith Packard <keithp at keithp.com>
Date:   Sun Jun 15 10:01:28 2008 +0930

    Xi: avoid double button mapping.
    
    Button events were mapped once in GetPointerEvents and then again in
    UpdateDeviceState. While it might make sense to just fix up UpdateDeviceState,
    it turns out to be better to leave the raw button number in the event because
    DGA reports raw device events without button translation, and so when it calls
    UpdateDeviceState, the button down counts get scrambled and buttons get stuck
    down.
    
    See also:
    http://lists.freedesktop.org/archives/xorg/2008-June/036201.html
    
    Signed-off-by: Peter Hutterer <peter at cs.unisa.edu.au>

diff --git a/Xi/exevents.c b/Xi/exevents.c
index 725c578..6f88b57 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1066,9 +1066,11 @@ ProcessOtherEvent(xEventPtr xE, DeviceIntPtr device, int count)
             (key == device->deviceGrab.activatingKey))
 	    deactivateDeviceGrab = TRUE;
     } else if (xE->u.u.type == DeviceButtonPress) {
-	xE->u.u.detail = key;
-	if (xE->u.u.detail == 0)
+	xE->u.u.detail = b->map[key];
+	if (xE->u.u.detail == 0) {
+	    xE->u.u.detail = key;
 	    return;
+	}
         if (!grab && CheckDeviceGrabs(device, xE, 0, count))
         {
             /* if a passive grab was activated, the event has been sent
@@ -1077,9 +1079,11 @@ ProcessOtherEvent(xEventPtr xE, DeviceIntPtr device, int count)
         }
 
     } else if (xE->u.u.type == DeviceButtonRelease) {
-	xE->u.u.detail = key;
-	if (xE->u.u.detail == 0)
+	xE->u.u.detail = b->map[key];
+	if (xE->u.u.detail == 0) {
+	    xE->u.u.detail = key;
 	    return;
+	}
         if (!b->state && device->deviceGrab.fromPassiveGrab)
             deactivateDeviceGrab = TRUE;
     }
@@ -1094,6 +1098,7 @@ ProcessOtherEvent(xEventPtr xE, DeviceIntPtr device, int count)
 
     if (deactivateDeviceGrab == TRUE)
 	(*device->deviceGrab.DeactivateGrab) (device);
+    xE->u.u.detail = key;
 }
 
 _X_EXPORT int
diff --git a/dix/getevents.c b/dix/getevents.c
index 5227c54..b00bc11 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -1030,7 +1030,7 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons,
             kbp->type = DeviceButtonPress;
         else if (type == ButtonRelease)
             kbp->type = DeviceButtonRelease;
-        kbp->detail = pDev->button->map[buttons];
+        kbp->detail = buttons;
     }
 
     kbp->root_x = cx; /* root_x/y always in screen coords */
commit d894e86aa5bea81147c4a7ad8630bcfb04156792
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Sun Jun 15 10:55:08 2008 +0930

    randr: remove superfluous check against uninitialised variable.
    
    Thanks to Eamon Walsh for pointing this out.

diff --git a/randr/rrpointer.c b/randr/rrpointer.c
index e3b8b03..6b934c0 100644
--- a/randr/rrpointer.c
+++ b/randr/rrpointer.c
@@ -136,14 +136,11 @@ RRPointerMoved (ScreenPtr pScreen, int x, int y)
 void
 RRPointerScreenConfigured (ScreenPtr pScreen)
 {
-    WindowPtr	pRoot; 
+    WindowPtr	pRoot;
     ScreenPtr	pCurrentScreen;
     int		x, y;
     DeviceIntPtr pDev;
 
-    if (pScreen != pCurrentScreen)
-	return;
-
     for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
     {
         if (IsPointerDevice(pDev))


More information about the xorg-commit mailing list