commit bb612ae782f5639339651d8a7f0debfc1470badf
Author: Colomban Wendling <cwendling@hypra.fr>
Date:   Thu Feb 7 10:00:07 2019 +0100

    Avoid temporary focus back on the original window when switching windows
    
    Prevent the original window from gaining back the focus for a short
    time after a switch from it to another window.  This is useful to
    prevent the original window from spamming the accessibility layer with
    focus change events that can lead to confusing situations.

diff --git a/plugins/switcher.c b/plugins/switcher.c
index ff3f3fb9..092eb7c3 100644
--- a/plugins/switcher.c
+++ b/plugins/switcher.c
@@ -762,7 +762,16 @@ switchTerminate (CompDisplay     *d,
 	    }
 
 	    if (state && ss->selectedWindow && !ss->selectedWindow->destroyed)
+	    {
+		/* Move input focus to the selected window to prevent the
+		 * previously active window from getting the focus back for a
+		 * short time before the request below gets processed.  This
+		 * is useful to prevent some applications from spamming the
+		 * Accessibility layer and leading to confusing situations. */
+		moveInputFocusToWindow (ss->selectedWindow);
+
 		sendWindowActivationRequest (s, ss->selectedWindow->id);
+	    }
 
 	    removeScreenGrab (s, ss->grabIndex, 0);
 	    ss->grabIndex = 0;
