xserver: Branch 'server-1.4-branch'

Daniel Stone daniels at kemper.freedesktop.org
Tue Jun 10 08:34:46 PDT 2008


 Xi/exevents.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

New commits:
commit 4d59afd613cd7e82255fc83e921300f6bd3a7552
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Tue Jun 10 18:33:57 2008 +0300

    Xi: event_{x,y} should refer to the extended device (bug #16289)
    
    ProcessOtherEvents was unconditionally stomping the root_{x,y}
    co-ordinates provided by GetPointerEvents with those of the core
    pointer, meaning that both root_{x,y} and event_{x,y} reported to
    clients would reflect the sprite's position, not the position reported
    by the device that generated the DeviceMotionNotify or the
    DeviceButton{Press,Release} event in the first place.
    
    For key events we still take the sprite's co-ords, as we're delivering
    to the focus, which is the (VCP) sprite.
    
    Not cherry-picked from master as MPX fixes this anyway, by taking the
    co-ords of the sprite the device moves (be it visible or no).
    (cherry picked from commit 8259d19f7155d82197ecc2aa16b316376c2dcb12)

diff --git a/Xi/exevents.c b/Xi/exevents.c
index 7cf0c50..0de5ea8 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -123,9 +123,14 @@ ProcessOtherEvent(xEventPtr xE, DeviceIntPtr other, int count)
     deviceValuator *xV = (deviceValuator *) xE;
 
     if (xE->u.u.type != DeviceValuator) {
-	GetSpritePosition(&rootX, &rootY);
-	xE->u.keyButtonPointer.rootX = rootX;
-	xE->u.keyButtonPointer.rootY = rootY;
+        /* Other types already have root{X,Y} filled in. */
+        if (xE->u.u.type == DeviceKeyPress ||
+            xE->u.u.type == DeviceKeyRelease) {
+	    GetSpritePosition(&rootX, &rootY);
+	    xE->u.keyButtonPointer.rootX = rootX;
+	    xE->u.keyButtonPointer.rootY = rootY;
+        }
+
 	key = xE->u.u.detail;
 	NoticeEventTime(xE);
 	xE->u.keyButtonPointer.state = inputInfo.keyboard->key->state |


More information about the xorg-commit mailing list