From c32781687dc76e62639ed7714bae8b2be5689e5a Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <fourdan.olivier@wanadoo.fr>
Date: Mon, 3 Dec 2007 21:43:32 +0000
Subject: [PATCH] Rework focus transition since now parents get raised along
 with the transients - That makes things more predictible.

(Old svn revision: 26434)
---
 src/focus.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/focus.c b/src/focus.c
index fcf852858..31d7a65b6 100644
--- a/src/focus.c
+++ b/src/focus.c
@@ -305,7 +305,7 @@ clientPassFocus (ScreenInfo *screen_info, Client *c, Client *exclude)
     new_focus = NULL;
     current_focus = client_focus;
     c2 = NULL;
-#if 0
+#if 1
     if (pending_focus)
     {
         current_focus = pending_focus;
@@ -323,14 +323,15 @@ clientPassFocus (ScreenInfo *screen_info, Client *c, Client *exclude)
 
     display_info = screen_info->display_info;
     top_most = clientGetTopMostFocusable (screen_info, look_in_layer, exclude);
+#if 0
     if (screen_info->params->click_to_focus)
     {
         if (c)
         {
-            if (clientIsTransientOrModal (c))
+            if (clientIsModal (c))
             {
-                /* If the window is a transient or modal, send focus back to
-                 * its parent window.
+                /* If the window is a modal, send focus back to its parent
+                 * window.
                  * Modals are transients, and we aren't interested in modal
                  * for group, so it safe to use clientGetTransient because
                  * it's really what we want...
@@ -353,7 +354,10 @@ clientPassFocus (ScreenInfo *screen_info, Client *c, Client *exclude)
             }
         }
     }
-    else if (XQueryPointer (myScreenGetXDisplay (screen_info), screen_info->xroot, &dr, &window, &rx, &ry, &wx, &wy, &mask))
+    else
+#endif
+    if (!(screen_info->params->click_to_focus) &&
+        XQueryPointer (myScreenGetXDisplay (screen_info), screen_info->xroot, &dr, &window, &rx, &ry, &wx, &wy, &mask))
     {
         new_focus = clientAtPosition (screen_info, rx, ry, exclude);
     }
-- 
GitLab