xserver: Branch 'xephyr-crash' - 2 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Nov 19 19:37:12 UTC 2018


Rebased ref, commits from common ancestor:
commit 8738ce85df535bdfdfecfce1c0d64e209cc6e508
Author: Ray Strode <rstrode at redhat.com>
Date:   Fri Nov 16 14:36:55 2018 -0500

    dix: ensure work queues are cleared on reset
    
    If the server resets, most client workqueues are cleaned up as the
    clients are killed.
    
    The one exception is the server's client, which is exempt from
    the killing spree.
    
    If that client has a queued work procedure active, it won't get
    cleared on reset.
    
    This commit ensures it gets cleared too.

diff --git a/dix/dixutils.c b/dix/dixutils.c
index 540023cbd..2983174a1 100644
--- a/dix/dixutils.c
+++ b/dix/dixutils.c
@@ -508,6 +508,19 @@ WorkQueuePtr workQueue;
 static WorkQueuePtr *workQueueLast = &workQueue;
 
 void
+ClearWorkQueue(void)
+{
+    WorkQueuePtr q, *p;
+
+    p = &workQueue;
+    while ((q = *p)) {
+        *p = q->next;
+        free(q);
+    }
+    workQueueLast = p;
+}
+
+void
 ProcessWorkQueue(void)
 {
     WorkQueuePtr q, *p;
diff --git a/dix/main.c b/dix/main.c
index 273f30330..16a7d6d39 100644
--- a/dix/main.c
+++ b/dix/main.c
@@ -340,6 +340,8 @@ dix_main(int argc, char *argv[], char *envp[])
 
         DeleteCallbackManager();
 
+        ClearWorkQueue();
+
         if (dispatchException & DE_TERMINATE) {
             CloseWellKnownConnections();
         }
diff --git a/include/dix.h b/include/dix.h
index cf263a1f5..f2516187f 100644
--- a/include/dix.h
+++ b/include/dix.h
@@ -240,6 +240,8 @@ extern _X_EXPORT void RemoveBlockAndWakeupHandlers(ServerBlockHandlerProcPtr blo
 
 extern _X_EXPORT void InitBlockAndWakeupHandlers(void);
 
+extern _X_EXPORT void ClearWorkQueue(void);
+
 extern _X_EXPORT void ProcessWorkQueue(void);
 
 extern _X_EXPORT void ProcessWorkQueueZombies(void);
commit 364d64981549544213e2bca8de6ff8a5b2b5a69e
Author: Samuel Thibault <samuel.thibault at ens-lyon.org>
Date:   Tue Oct 30 18:43:51 2018 +0100

    dix: do not send focus event when grab actually does not change
    
    c67f2eac5651 ("dix: always send focus event on grab change") made dix
    always sent events when it's a NotifyGrab or NotifyUngrab, even if
    from == to, because 'from' can just come from a previous XSetInputFocus
    call.
    
    However, when an application calls XGrabKeyboard several times on
    the same window, we are now sending spurious FocusOut+FocusIn with
    NotifyGrab, even if the grab does not actually change. This makes screen
    readers for blind people spuriously emit activity events which disturb
    screen reading workflow when e.g. switching between menus.
    
    This commit avoids calling DoFocusEvents in that precise case, i.e. when
    oldWin is a previous grab and the new grab is the same window.
    
    Signed-off-by: Samuel Thibault <samuel.thibault at ens-lyon.org>
    Reviewed-by: Adam Jackson <ajax at redhat.com>

diff --git a/dix/events.c b/dix/events.c
index b12d731dd..98ea15b5b 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -1530,7 +1530,9 @@ ActivatePointerGrab(DeviceIntPtr mouse, GrabPtr grab,
                 mouse->spriteInfo->sprite->hotPhys.y = 0;
         ConfineCursorToWindow(mouse, grab->confineTo, FALSE, TRUE);
     }
-    DoEnterLeaveEvents(mouse, mouse->id, oldWin, grab->window, NotifyGrab);
+    if (! (grabinfo->grab && oldWin == grabinfo->grab->window
+			  && oldWin == grab->window))
+        DoEnterLeaveEvents(mouse, mouse->id, oldWin, grab->window, NotifyGrab);
     mouse->valuator->motionHintWindow = NullWindow;
     if (syncEvents.playingEvents)
         grabinfo->grabTime = syncEvents.time;
@@ -1640,7 +1642,9 @@ ActivateKeyboardGrab(DeviceIntPtr keybd, GrabPtr grab, TimeStamp time,
         oldWin = keybd->focus->win;
     if (keybd->valuator)
         keybd->valuator->motionHintWindow = NullWindow;
-    if (oldWin)
+    if (oldWin &&
+	! (grabinfo->grab && oldWin == grabinfo->grab->window
+			  && oldWin == grab->window))
         DoFocusEvents(keybd, oldWin, grab->window, NotifyGrab);
     if (syncEvents.playingEvents)
         grabinfo->grabTime = syncEvents.time;


More information about the xorg-commit mailing list