xserver: Branch 'master' - 2 commits

Keith Packard keithp at kemper.freedesktop.org
Tue Oct 9 21:52:04 PDT 2012


 dix/events.c |   16 ++++++++++++----
 os/osinit.c  |    2 +-
 2 files changed, 13 insertions(+), 5 deletions(-)

New commits:
commit 4b7f00346daed20c96f3e8ea13ae411858a5424b
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Oct 10 13:33:48 2012 +1000

    dix: fix crash on shutdown if a disabled device is still grabbed (XI1 grab)
    
    A disabled device doesn't have a sprite (less so a sprite->win) and triggers
    a NULL-pointer dereference on shutdown when all active grabs are released as
    part of the cleanup.
    
    Fix this by checking for sprite being non-null and setting the focus window
    to the NullWindow if it is. The rest of the patch just attempts to make
    things more readable.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/dix/events.c b/dix/events.c
index c0e330b..ddb5b34 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -1593,13 +1593,10 @@ DeactivateKeyboardGrab(DeviceIntPtr keybd)
 {
     GrabPtr grab = keybd->deviceGrab.grab;
     DeviceIntPtr dev;
-    WindowPtr focusWin = keybd->focus ? keybd->focus->win
-        : keybd->spriteInfo->sprite->win;
+    WindowPtr focusWin;
     Bool wasImplicit = (keybd->deviceGrab.fromPassiveGrab &&
                         keybd->deviceGrab.implicitGrab);
 
-    if (focusWin == FollowKeyboardWin)
-        focusWin = inputInfo.keyboard->focus->win;
     if (keybd->valuator)
         keybd->valuator->motionHintWindow = NullWindow;
     keybd->deviceGrab.grab = NullGrab;
@@ -1610,6 +1607,17 @@ DeactivateKeyboardGrab(DeviceIntPtr keybd)
         if (dev->deviceGrab.sync.other == grab)
             dev->deviceGrab.sync.other = NullGrab;
     }
+
+    if (keybd->focus)
+        focusWin = keybd->focus->win;
+    else if (keybd->spriteInfo->sprite)
+        focusWin = keybd->spriteInfo->sprite->win;
+    else
+        focusWin = NullWindow;
+
+    if (focusWin == FollowKeyboardWin)
+        focusWin = inputInfo.keyboard->focus->win;
+
     DoFocusEvents(keybd, grab->window, focusWin, NotifyUngrab);
 
     if (!wasImplicit && grab->grabtype == XI2)
commit 0c7109f3215378bb3ed6c00c71129a63ffb4e787
Author: Denys Vlasenko <dvlasenk at redhat.com>
Date:   Mon Oct 8 14:18:02 2012 +1000

    os: fix typo in OsSigHandler() error message
    
    Recieved → Received
    
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/os/osinit.c b/os/osinit.c
index 2eb1f7a..45ab527 100644
--- a/os/osinit.c
+++ b/os/osinit.c
@@ -129,7 +129,7 @@ OsSigHandler(int signo)
 
 #ifdef SA_SIGINFO
     if (sip->si_code == SI_USER) {
-        ErrorFSigSafe("Recieved signal %u sent by process %u, uid %u\n", signo,
+        ErrorFSigSafe("Received signal %u sent by process %u, uid %u\n", signo,
                      sip->si_pid, sip->si_uid);
     }
     else {


More information about the xorg-commit mailing list