xserver: Branch 'master' - 2 commits

Keith Packard keithp at kemper.freedesktop.org
Wed Dec 21 09:43:49 PST 2011


 dix/events.c     |    5 +++--
 dix/inpututils.c |    2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

New commits:
commit fcda98c48610fd507ca0b89c6006a5497d9dc1c9
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Dec 16 12:41:08 2011 +1000

    dix: button state must show the logical buttons, not physical buttons
    
    If the device is mapped 3 2 1, a click on physical button 1 sends a button 3
    press, but the state was set for button 1. Fix this, the state must be set
    for that button's logical mapping.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=655928
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Chase Douglas <chase.douglas at canonical.com>

diff --git a/dix/inpututils.c b/dix/inpututils.c
index 8cd4d59..e1a11a1 100644
--- a/dix/inpututils.c
+++ b/dix/inpututils.c
@@ -672,7 +672,7 @@ void event_set_state(DeviceIntPtr mouse, DeviceIntPtr kbd, DeviceEvent *event)
 
     for (i = 0; mouse && mouse->button && i < mouse->button->numButtons; i++)
         if (BitIsOn(mouse->button->down, i))
-            SetBit(event->buttons, i);
+            SetBit(event->buttons, mouse->button->map[i]);
 
     if (kbd && kbd->key)
     {
commit 47da6b6b2c2e9245422655f94770146fb8cd430b
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Dec 19 14:52:41 2011 +1000

    dix: don't retrieve the syncEvents tail on an empty list
    
    An empty list points to itself but syncEvents has the list head only and is
    of a different format than the elements. Thus, casting it to a QdEventPtr
    gives us garbage.
    
    Segfaults with XTS test case Xlib13/XGrabKeyboard
    
    Introduced in 7af23259d88f4c28ed21140f82cc03b3724c06bb.
    
    Reported-by: Aaron Plattner <aplattner at nvidia.com>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Chase Douglas <chase.douglas at canonical.com>

diff --git a/dix/events.c b/dix/events.c
index 8dff299..eb7bd92 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -1115,13 +1115,14 @@ NoticeEventTime(InternalEvent *ev)
 void
 EnqueueEvent(InternalEvent *ev, DeviceIntPtr device)
 {
-    QdEventPtr	tail;
+    QdEventPtr	tail = NULL;
     QdEventPtr	qe;
     SpritePtr	pSprite = device->spriteInfo->sprite;
     int		eventlen;
     DeviceEvent *event = &ev->device_event;
 
-    tail = list_last_entry(&syncEvents.pending, QdEventRec, next);
+    if (!list_is_empty(&syncEvents.pending))
+        tail = list_last_entry(&syncEvents.pending, QdEventRec, next);
 
     NoticeTime((InternalEvent*)event);
 


More information about the xorg-commit mailing list