xserver: Branch 'server-1.12-branch' - 5 commits

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Wed May 2 21:11:21 PDT 2012


 dix/devices.c                         |    2 ++
 dix/getevents.c                       |    3 +++
 dix/touch.c                           |    5 +++++
 hw/xquartz/mach-startup/bundle-main.c |    2 +-
 os/WaitFor.c                          |   18 ++++++++++++++++--
 5 files changed, 27 insertions(+), 3 deletions(-)

New commits:
commit 22a1953c4a2747d637bb926034f11134809b8d06
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Thu Apr 26 21:17:54 2012 -0700

    XQuartz: Make sure we tell startx the correct server binary to use in our fallback path
    
    With multiple servers installed, we can't be certain if X is Xorg or Xquartz
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
    (cherry picked from commit 93d6ba5b711cbd3f502d83e54c9739856d2e6f2a)

diff --git a/hw/xquartz/mach-startup/bundle-main.c b/hw/xquartz/mach-startup/bundle-main.c
index d1ad6f7..cabdf1e 100644
--- a/hw/xquartz/mach-startup/bundle-main.c
+++ b/hw/xquartz/mach-startup/bundle-main.c
@@ -78,7 +78,7 @@ FatalError(const char *f, ...) _X_ATTRIBUTE_PRINTF(1, 2) _X_NORETURN;
 extern int noPanoramiXExtension;
 
 #define DEFAULT_CLIENT X11BINDIR "/xterm"
-#define DEFAULT_STARTX X11BINDIR "/startx"
+#define DEFAULT_STARTX X11BINDIR "/startx -- " X11BINDIR "/Xquartz"
 #define DEFAULT_SHELL  "/bin/sh"
 
 #ifndef BUILD_DATE
commit 90299556db24543bb7365e8c2897deca3aa219e7
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Apr 30 10:01:48 2012 +1000

    dix: when disabling a device, release all buttons and keys
    
    A suspend-induced device disable may happen before the device gets to see
    the button release event. On resume, the server's internal state still has
    some buttons pressed, causing inconsistent behaviour.
    
    Force the release and the matching events to be sent to the client.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Chase Douglas <chase.douglas at canonical.com>
    (cherry picked from commit f3410b97cf9b48a47bee3d15d232f8a88e75f4ef)
    
    Conflicts:
    
    	dix/devices.c

diff --git a/dix/devices.c b/dix/devices.c
index 0125504..d0e99bd 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -432,6 +432,8 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent)
     if (*prev != dev)
         return FALSE;
 
+    ReleaseButtonsAndKeys(dev);
+
     /* float attached devices */
     if (IsMaster(dev)) {
         for (other = inputInfo.devices; other; other = other->next) {
commit b53cdf4c53f0787ed41281278877e0405fcb2674
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Apr 27 16:31:17 2012 +1000

    dix: don't emulate scroll events for non-existing axes (#47281)
    
    Test case:
    - create a device with REL_HWHEEL and ABS_X and ABS_Y. evdev 2.7.0 will set
      that up as device with 1 relative axis
    - move pointer to VGA1
    - xrandr --output VGA1 --off
    
    Warps the pointer to the new spot and calls GPE with the x/y mask bits set.
    When running through the loop to check for scroll event, this overruns the
    axes and may try to emulate scroll events based on random garbage in the
    memory. If that memory contained non-zero for the scroll type but near-zero
    for the increment field, the server would hang in an infinite loop.
    
    This was the trigger for this suggested, never-merged, patch here:
    http://patchwork.freedesktop.org/patch/9543/
    
    X.Org Bug 47281 <http://bugs.freedesktop.org/show_bug.cgi?id=47281>
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Chase Douglas <chase.douglas at canonical.com>
    (cherry picked from commit af88b43f9e604157b74270d609c08bdfa256a792)

diff --git a/dix/getevents.c b/dix/getevents.c
index fa85fe7..4e0af45 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -1574,6 +1574,9 @@ GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type,
     /* Now turn the smooth-scrolling axes back into emulated button presses
      * for legacy clients, based on the integer delta between before and now */
     for (i = 0; i < valuator_mask_size(&mask); i++) {
+        if (i >= pDev->valuator->numAxes)
+            break;
+
         if (!valuator_mask_isset(&mask, i))
             continue;
 
commit 9ddf9e2388f9ac5f4c325304ab0c59c1fd5e2024
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Apr 27 10:52:39 2012 +1000

    os: make timers signal-safe
    
    If TimerSet() is called from a signal handler (synaptics tap handling code)
    may result in list corruption if we're currently inside TimerSet().
    
    See backtrace in
    https://bugzilla.redhat.com/show_bug.cgi?id=814869
    
    Block signals for all list manipulations in the timers.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Chase Douglas <chase.douglas at canonical.com>
    (cherry picked from commit 08962951de969b9d8c870af8b6e47303dc0decfd)

diff --git a/os/WaitFor.c b/os/WaitFor.c
index 4c3be34..59f3af6 100644
--- a/os/WaitFor.c
+++ b/os/WaitFor.c
@@ -382,6 +382,7 @@ CheckAllTimers(void)
     OsTimerPtr timer;
     CARD32 now;
 
+    OsBlockSignals();
  start:
     now = GetTimeInMillis();
 
@@ -391,6 +392,7 @@ CheckAllTimers(void)
             goto start;
         }
     }
+    OsReleaseSignals();
 }
 
 static void
@@ -398,11 +400,13 @@ DoTimer(OsTimerPtr timer, CARD32 now, OsTimerPtr *prev)
 {
     CARD32 newTime;
 
+    OsBlockSignals();
     *prev = timer->next;
     timer->next = NULL;
     newTime = (*timer->callback) (timer, now, timer->arg);
     if (newTime)
         TimerSet(timer, 0, newTime, timer->callback, timer->arg);
+    OsReleaseSignals();
 }
 
 OsTimerPtr
@@ -418,6 +422,7 @@ TimerSet(OsTimerPtr timer, int flags, CARD32 millis,
             return NULL;
     }
     else {
+        OsBlockSignals();
         for (prev = &timers; *prev; prev = &(*prev)->next) {
             if (*prev == timer) {
                 *prev = timer->next;
@@ -426,6 +431,7 @@ TimerSet(OsTimerPtr timer, int flags, CARD32 millis,
                 break;
             }
         }
+        OsReleaseSignals();
     }
     if (!millis)
         return timer;
@@ -445,26 +451,32 @@ TimerSet(OsTimerPtr timer, int flags, CARD32 millis,
         if (!millis)
             return timer;
     }
+    OsBlockSignals();
     for (prev = &timers;
          *prev && (int) ((*prev)->expires - millis) <= 0;
          prev = &(*prev)->next);
     timer->next = *prev;
     *prev = timer;
+    OsReleaseSignals();
     return timer;
 }
 
 Bool
 TimerForce(OsTimerPtr timer)
 {
+    int rc = FALSE;
     OsTimerPtr *prev;
 
+    OsBlockSignals();
     for (prev = &timers; *prev; prev = &(*prev)->next) {
         if (*prev == timer) {
             DoTimer(timer, GetTimeInMillis(), prev);
-            return TRUE;
+            rc = TRUE;
+            break;
         }
     }
-    return FALSE;
+    OsReleaseSignals();
+    return rc;
 }
 
 void
@@ -474,12 +486,14 @@ TimerCancel(OsTimerPtr timer)
 
     if (!timer)
         return;
+    OsBlockSignals();
     for (prev = &timers; *prev; prev = &(*prev)->next) {
         if (*prev == timer) {
             *prev = timer->next;
             break;
         }
     }
+    OsReleaseSignals();
 }
 
 void
commit 345761be71b86b687f407eb8de746a33bab7ad2e
Author: Chase Douglas <chase.douglas at canonical.com>
Date:   Fri Apr 20 11:08:15 2012 -0700

    TouchListenerAcceptReject: Warn and return early on bad listener index
    
    Signed-off-by: Chase Douglas <chase.douglas at canonical.com>
    Reviewed-by: Bryce Harrington <bryce at canonical.com>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit 5c361d59c5031d9b3f7f9093a52d2b1ff4d9ae5f)

diff --git a/dix/touch.c b/dix/touch.c
index dd16367..401cb98 100644
--- a/dix/touch.c
+++ b/dix/touch.c
@@ -966,6 +966,11 @@ TouchListenerAcceptReject(DeviceIntPtr dev, TouchPointInfoPtr ti, int listener,
     int nev;
     int i;
 
+    BUG_WARN(listener < 0);
+    BUG_WARN(listener >= ti->num_listeners);
+    if (listener < 0 || listener >= ti->num_listeners)
+        return BadMatch;
+
     if (listener > 0) {
         if (mode == XIRejectTouch)
             TouchRejected(dev, ti, ti->listeners[listener].listener, NULL);


More information about the xorg-commit mailing list