xserver: Branch 'master' - 6 commits

Keith Packard keithp at kemper.freedesktop.org
Thu Oct 4 13:07:39 PDT 2012


 Xi/exevents.c                  |    2 --
 dix/events.c                   |    9 ++++++---
 hw/xfree86/common/xf86Opt.h    |    2 +-
 hw/xfree86/common/xf86Option.c |    2 +-
 mi/mipointer.c                 |    5 -----
 5 files changed, 8 insertions(+), 12 deletions(-)

New commits:
commit 8367dd9736d74eca971da345c2bf559ce5bbf649
Merge: 36c18bb... 7998e26...
Author: Keith Packard <keithp at keithp.com>
Date:   Thu Oct 4 13:08:35 2012 -0700

    Merge remote-tracking branch 'whot/for-keith'

commit 7998e26159893674be69183a73a89a53f5608d58
Author: Jason Gerecke <killertofu at gmail.com>
Date:   Fri Sep 28 15:03:42 2012 -0700

    Fix additional gcc -Wwrite-strings warning in xf86 ddx
    
    Commit 09e4b78f missed a case.
    
    Signed-off-by: Jason Gerecke <killertofu at gmail.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/hw/xfree86/common/xf86Opt.h b/hw/xfree86/common/xf86Opt.h
index 0d808de..c3ba2d7 100644
--- a/hw/xfree86/common/xf86Opt.h
+++ b/hw/xfree86/common/xf86Opt.h
@@ -85,7 +85,7 @@ extern _X_EXPORT int xf86CheckIntOption(XF86OptionPtr optlist, const char *name,
 extern _X_EXPORT double xf86CheckRealOption(XF86OptionPtr optlist,
                                             const char *name, double deflt);
 extern _X_EXPORT char *xf86CheckStrOption(XF86OptionPtr optlist,
-                                          const char *name, char *deflt);
+                                          const char *name, const char *deflt);
 extern _X_EXPORT int xf86CheckBoolOption(XF86OptionPtr list, const char *name,
                                          int deflt);
 extern _X_EXPORT double xf86CheckPercentOption(XF86OptionPtr list,
diff --git a/hw/xfree86/common/xf86Option.c b/hw/xfree86/common/xf86Option.c
index 7cc7440..c2ec79a 100644
--- a/hw/xfree86/common/xf86Option.c
+++ b/hw/xfree86/common/xf86Option.c
@@ -276,7 +276,7 @@ xf86CheckRealOption(XF86OptionPtr optlist, const char *name, double deflt)
 }
 
 char *
-xf86CheckStrOption(XF86OptionPtr optlist, const char *name, char *deflt)
+xf86CheckStrOption(XF86OptionPtr optlist, const char *name, const char *deflt)
 {
     return LookupStrOption(optlist, name, deflt, FALSE);
 }
commit f64254d85e731d0b4369d871a9a735b03f283ba6
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Thu Aug 23 15:00:24 2012 +1000

    mi: drop two useless conditions in miPointerSetPosition
    
    pDev cannot be NULL here since fill_pointer_events is the only caller.
    And if the screen is NULL, then the device tries to send events before it is
    fully initialised. That certainly shouldn't happen and would be a bug
    elsewhere.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/mi/mipointer.c b/mi/mipointer.c
index 4defaf5..f345063 100644
--- a/mi/mipointer.c
+++ b/mi/mipointer.c
@@ -575,13 +575,8 @@ miPointerSetPosition(DeviceIntPtr pDev, int mode, double *screenx,
 
     miPointerPtr pPointer;
 
-    if (!pDev)
-        return NULL;
-
     pPointer = MIPOINTER(pDev);
     pScreen = pPointer->pScreen;
-    if (!pScreen)
-        return NULL;            /* called before ready */
 
     x = trunc(*screenx);
     y = trunc(*screeny);
commit 314776eb369ca2e438907795ae030dd743c281fc
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Fri Sep 7 18:30:23 2012 +0100

    Touch: Fix duplicate TouchBegin selection with virtual devices
    
    Given the following scenario:
      1) client A selects for TouchBegin on window W for device D
      2) client B selects for TouchBegin on window W for XIAllDevices
      3) client C selects for TouchBegin on window W with device E
    
    Step 3 will fail with BadImplementation, because attempting to look up
    XIAllDevices or XIAllMasterDevices with dixLookupDevices doesn't work.
    This should succeed (or, if it was selecting for device D, fail with
    BadAccess as it would be a duplicate selection).
    
    Fix this by performing the appropriate lookup for virtual devices.
    
    Signed-off-by: Daniel Stone <daniel at fooishbar.org>
    Cc: Peter Hutterer <peter.hutterer at who-t.net>
    Cc: Chase Douglas <chase.douglas at ubuntu.com>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/Xi/xiselectev.c b/Xi/xiselectev.c
index 0e45cb8..ab1b624 100644
--- a/Xi/xiselectev.c
+++ b/Xi/xiselectev.c
@@ -180,8 +180,13 @@ ProcXISelectEvents(ClientPtr client)
                     if (CLIENT_ID(iclient->resource) == client->index)
                         continue;
 
-                    dixLookupDevice(&tmp, evmask->deviceid, serverClient,
-                                    DixReadAccess);
+                    if (evmask->deviceid == XIAllDevices)
+                        tmp = inputInfo.all_devices;
+                    else if (evmask->deviceid == XIAllMasterDevices)
+                        tmp = inputInfo.all_master_devices;
+                    else
+                        dixLookupDevice(&tmp, evmask->deviceid, serverClient,
+                                        DixReadAccess);
                     if (!tmp)
                         return BadImplementation;       /* this shouldn't happen */
 
commit 3e6358ee6c33979329b78fe2097a1fdf76fb69cd
Author: Daniel Drake <dsd at laptop.org>
Date:   Fri Sep 7 21:48:35 2012 -0400

    Xi: Don't check for TOUCH_END, it's never set
    
    This flag is never set, so checking for it here means that we'll
    never release the simulated mouse button press after the user touches
    (and releases) the touchscreen for the first time.
    
    Fixes a problem where the XO laptop touchpad became totally
    unusable after touching the screen for the first time (since X then
    behaved as if the mouse button was held down all the time).
    
    Signed-off-by: Daniel Drake <dsd at laptop.org>
    Reviewed-by: Chase Douglas <chase.douglas at canonical.com>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/Xi/exevents.c b/Xi/exevents.c
index 494d07e..6ed4991 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -949,8 +949,6 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent *event)
 
         if (!(event->flags & TOUCH_POINTER_EMULATED))
             return DONT_PROCESS;
-        if (!(event->flags & TOUCH_END))
-            return DONT_PROCESS;
 
         DecreaseButtonCount(device, key, &t->buttonsDown, &t->motionMask,
                             &t->state);
commit 9d6b8365702e4648e793fea21ad22f7174558680
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Sep 28 11:49:29 2012 +1000

    dix: fix crash on XI 1.x grabs on disabled devices.  (#54934)
    
    If the device is disabled, the sprite window is NULL and dereferencing
    crashes the server.
    
    This is only triggered for XI 1.x grabs (ProcXGrabDevice) as XI2 grabs would
    trigger another code path, creating a sprite for the disabled device as if
    detaching it (which is wrong and fixed with this patch too).
    
    Grabbing a disabled device doesn't make sense as it won't send events
    anyway. However, the protocol specs do not prohibit it, so we need to keep
    it working.
    Luckily, oldWin is only used for focus out events, which aren't necessary
    given that the device is disabled.
    
    X.Org Bug 54934 <http://bugs.freedesktop.org/show_bug.cgi?id=54934>
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Chase Douglas <chase.douglas at ubuntu.com>

diff --git a/dix/events.c b/dix/events.c
index 3b40446..c0e330b 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -1555,11 +1555,13 @@ ActivateKeyboardGrab(DeviceIntPtr keybd, GrabPtr grab, TimeStamp time,
     WindowPtr oldWin;
 
     /* slave devices need to float for the duration of the grab. */
-    if (grab->grabtype == XI2 &&
+    if (grab->grabtype == XI2 && keybd->enabled &&
         !(passive & ImplicitGrabMask) && !IsMaster(keybd))
         DetachFromMaster(keybd);
 
-    if (grabinfo->grab)
+    if (!keybd->enabled)
+        oldWin = NULL;
+    else if (grabinfo->grab)
         oldWin = grabinfo->grab->window;
     else if (keybd->focus)
         oldWin = keybd->focus->win;
@@ -1569,7 +1571,8 @@ ActivateKeyboardGrab(DeviceIntPtr keybd, GrabPtr grab, TimeStamp time,
         oldWin = keybd->focus->win;
     if (keybd->valuator)
         keybd->valuator->motionHintWindow = NullWindow;
-    DoFocusEvents(keybd, oldWin, grab->window, NotifyGrab);
+    if (oldWin)
+        DoFocusEvents(keybd, oldWin, grab->window, NotifyGrab);
     if (syncEvents.playingEvents)
         grabinfo->grabTime = syncEvents.time;
     else


More information about the xorg-commit mailing list