xserver: Branch 'mpx' - 5 commits

Peter Hutterer whot at kemper.freedesktop.org
Fri May 16 17:41:05 PDT 2008


 Xext/xtest.c                |    2 +-
 Xi/exevents.c               |   43 +++++++++++++++++++++----------------------
 dix/devices.c               |    3 ++-
 hw/vfb/InitInput.c          |    1 -
 hw/xfree86/common/xf86DGA.c |    4 ++--
 hw/xnest/Events.c           |    1 -
 mi/mipointer.c              |    8 +-------
 mi/mipointer.h              |    5 -----
 8 files changed, 27 insertions(+), 40 deletions(-)

New commits:
commit fc7e2566cc076c0d979f74871bc436df43401058
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Fri May 16 16:59:34 2008 +0930

    Xext: fix typo in condition.
    
    Fall-out from dc3aba8a559d4304844ee1cc306c577a63b82762.
    We must free the event if it is NOT an extension event.

diff --git a/Xext/xtest.c b/Xext/xtest.c
index 791f6a2..a42faa7 100644
--- a/Xext/xtest.c
+++ b/Xext/xtest.c
@@ -500,7 +500,7 @@ ProcXTestFakeInput(client)
         xfree(master_event);
     } else
         (*dev->public.processInputProc)(ev, dev, nev);
-    if (extension)
+    if (!extension)
         xfree(ev);
     return client->noClientException;
 }
commit 6fb76acc4524d6af4bfb6bc6d862c1ee2bbb8baa
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Fri May 16 19:22:32 2008 +0930

    mi: remove miPointerUpdate() -> replaced by miPointerUpdateSprite().
    
    In the xnest and vfb DDX we don't need the call anyway, it's performed by
    mieqProcessInputEvent.

diff --git a/hw/vfb/InitInput.c b/hw/vfb/InitInput.c
index 393698f..3b001ee 100644
--- a/hw/vfb/InitInput.c
+++ b/hw/vfb/InitInput.c
@@ -52,7 +52,6 @@ void
 ProcessInputEvents()
 {
     mieqProcessInputEvents();
-    miPointerUpdate();
 }
 
 void DDXRingBell(int volume, int pitch, int duration)
diff --git a/hw/xnest/Events.c b/hw/xnest/Events.c
index 02ff27b..f7a551c 100644
--- a/hw/xnest/Events.c
+++ b/hw/xnest/Events.c
@@ -49,7 +49,6 @@ void
 ProcessInputEvents()
 {
   mieqProcessInputEvents();
-  miPointerUpdate();
 }
 
 int
diff --git a/mi/mipointer.c b/mi/mipointer.c
index 2c226dc..484947d 100644
--- a/mi/mipointer.c
+++ b/mi/mipointer.c
@@ -374,18 +374,12 @@ miPointerWarpCursor (pDev, pScreen, x, y)
  */
 
 /*
- * miPointerUpdate
+ * miPointerUpdateSprite
  *
  * Syncronize the sprite with the cursor - called from ProcessInputEvents
  */
 
 void
-miPointerUpdate ()
-{
-    miPointerUpdateSprite(inputInfo.pointer);
-}
-
-void
 miPointerUpdateSprite (DeviceIntPtr pDev)
 {
     ScreenPtr		pScreen;
diff --git a/mi/mipointer.h b/mi/mipointer.h
index 5cbf527..fccbfa0 100644
--- a/mi/mipointer.h
+++ b/mi/mipointer.h
@@ -122,11 +122,6 @@ extern int miPointerGetMotionEvents(
     ScreenPtr /*pScreen*/
 );
 
-/* Deprecated in favour of miPointerUpdateSprite. */
-extern void miPointerUpdate(
-    void
-) _X_DEPRECATED;
-
 /* Deprecated in favour of miSetPointerPosition. */
 extern void miPointerDeltaCursor(
     int /*dx*/,
commit 5127942f80983b2e053dddd5c5747d0c3d2f9d6d
Author: Brian Rogers <brian_rogers at comcast.net>
Date:   Fri May 16 10:08:04 2008 +0930

    DGA: pass nevents to UpdateDeviceState. #15936
    
    Missing parameter caused event processing to go nuts when checking valuators.
    
    X.Org Bug 15936 <http://bugs.freedesktop.org/show_bug.cgi?id=15936>
    
    Signed-off-by: Peter Hutterer <peter at cs.unisa.edu.au>

diff --git a/hw/xfree86/common/xf86DGA.c b/hw/xfree86/common/xf86DGA.c
index 9c79505..a7e24a6 100644
--- a/hw/xfree86/common/xf86DGA.c
+++ b/hw/xfree86/common/xf86DGA.c
@@ -1043,7 +1043,7 @@ DGAProcessKeyboardEvent (ScreenPtr pScreen, dgaEvent *de, DeviceIntPtr keybd)
     de->u.event.state = keyc->state | pointer->button->state;
 
     de->u.u.type = (IEventBase - 1) + coreEquiv; /* change to XI event */
-    UpdateDeviceState(keybd, de);
+    UpdateDeviceState(keybd, de, 1);
     de->u.u.type = *XDGAEventBase + coreEquiv; /* change back */
 
     /*
@@ -1090,7 +1090,7 @@ DGAProcessPointerEvent (ScreenPtr pScreen, dgaEvent *de, DeviceIntPtr mouse)
     de->u.event.state = butc->state | GetPairedDevice(mouse)->key->state;
 
     de->u.u.type = (IEventBase - 1) + coreEquiv; /* change to XI event */
-    UpdateDeviceState(mouse, de);
+    UpdateDeviceState(mouse, de, 1);
     de->u.u.type = *XDGAEventBase + coreEquiv; /* change back */
 
     /*
commit 28378d26b4bae377ef1212f6a51cda9b5529f1b5
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Thu May 15 11:09:15 2008 +0930

    Xi: assemble button/modifier state before updating the device. #15934
    
    The state field of the event must specify the state of the devices before the
    event occured. With the code as it was, the state would also include the
    event (e.g. state from a button press event would show the button as pressed)
    Gathering the state before updating the device should fix this.
    
    X.Org Bug 15934 <http://bugs.freedesktop.org/show_bug.cgi?id=15934>

diff --git a/Xi/exevents.c b/Xi/exevents.c
index b284547..42b77c1 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1021,6 +1021,26 @@ ProcessOtherEvent(xEventPtr xE, DeviceIntPtr device, int count)
     ValuatorClassPtr v;
     deviceValuator *xV  = (deviceValuator *) xE;
     int ret = 0;
+    int state;
+    DeviceIntPtr mouse = NULL, kbd = NULL;
+
+    if (IsPointerDevice(device))
+    {
+        kbd = GetPairedDevice(device);
+        mouse = device;
+        if (!kbd->key) /* can happen with floating SDs */
+            kbd = NULL;
+    } else
+    {
+        mouse = GetPairedDevice(device);
+        kbd = device;
+        if (!mouse->valuator || !mouse->button) /* may be float. SDs */
+            mouse = NULL;
+    }
+
+    /* State needs to be assembled BEFORE the device is updated. */
+    state = (kbd) ? kbd->key->state : 0;
+    state |= (mouse) ? (mouse->button->state) : 0;
 
     ret = UpdateDeviceState(device, xE, count);
     if (ret == DONT_PROCESS)
@@ -1034,33 +1054,12 @@ ProcessOtherEvent(xEventPtr xE, DeviceIntPtr device, int count)
         CheckMotion(xE, device);
 
     if (xE->u.u.type != DeviceValuator && xE->u.u.type != GenericEvent) {
-        DeviceIntPtr mouse = NULL, kbd = NULL;
 	GetSpritePosition(device, &rootX, &rootY);
 	xE->u.keyButtonPointer.rootX = rootX;
 	xE->u.keyButtonPointer.rootY = rootY;
 	NoticeEventTime(xE);
 
-        /* If 'device' is a pointer device, we need to get the paired keyboard
-         * for the state. If there is none, the kbd bits of state are 0.
-         * If 'device' is a keyboard device, get the paired pointer and use the
-         * pointer's state for the button bits.
-         */
-        if (IsPointerDevice(device))
-        {
-            kbd = GetPairedDevice(device);
-            mouse = device;
-            if (!kbd->key) /* can happen with floating SDs */
-                kbd = NULL;
-        }
-        else
-        {
-            mouse = GetPairedDevice(device);
-            kbd = device;
-            if (!mouse->valuator || !mouse->button) /* may be float. SDs */
-                mouse = NULL;
-        }
-        xE->u.keyButtonPointer.state = (kbd) ? (kbd->key->state) : 0;
-        xE->u.keyButtonPointer.state |= (mouse) ? (mouse->button->state) : 0;
+        xE->u.keyButtonPointer.state = state;
 
         key = xE->u.u.detail;
     }
commit 937e5aae33d3b5112b5d10d605e25f57b48caa3f
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Wed May 14 22:30:15 2008 +0930

    dix: don't undisplay cursor if we don't own a sprite.
    
    Sometimes we didn't have a cursor when coming back from suspend. Reason was
    that the suspend caused the server to lose the device that was attached to the
    VCP, and a RemoveDevice() would then set the cursor to NULL.
    Solution: only set the cursor to NULL if we actually own the sprite.

diff --git a/dix/devices.c b/dix/devices.c
index 05a6b51..4dd1dc5 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -885,7 +885,8 @@ RemoveDevice(DeviceIntPtr dev)
         return BadImplementation;
 
     initialized = dev->inited;
-    screen->DisplayCursor(dev, screen, NullCursor);
+    if (DevHasCursor(dev))
+        screen->DisplayCursor(dev, screen, NullCursor);
 
     deviceid = dev->id;
     DisableDevice(dev);


More information about the xorg-commit mailing list