[Xfce4-commits] r27067 - xfwm4/trunk/src

Olivier Fourdan olivier at xfce.org
Sun Jun 15 13:30:14 CEST 2008


Author: olivier
Date: 2008-06-15 11:30:14 +0000 (Sun, 15 Jun 2008)
New Revision: 27067

Modified:
   xfwm4/trunk/src/focus.c
Log:
Set focus to the fallback window when relying only on TakeFocus to avoid a race condition with the client application

Modified: xfwm4/trunk/src/focus.c
===================================================================
--- xfwm4/trunk/src/focus.c	2008-06-15 09:44:50 UTC (rev 27066)
+++ xfwm4/trunk/src/focus.c	2008-06-15 11:30:14 UTC (rev 27067)
@@ -595,9 +595,15 @@
             }
             clientUpdateOpacity (screen_info, c);
         }
-        else if (!client_focus)
+        else
         {
-            /* Hack to prevent loosing focus when all remaining windows won't accept focus, see bug #1853 */
+            /*
+             * If we are relying only on the client application to take focus, we need to set the focus
+             * explicitely on our own fallback window otherwise there is a race condition between the
+             * application and the window manager. If the application does not take focus before the
+             * the previously focused window is unmapped (when iconifying or closing for example), the focus
+             * will be reverted to the root window and focus transition will fail.
+             */
             XSetInputFocus (myScreenGetXDisplay (screen_info), screen_info->xfwm4_win, RevertToPointerRoot, timestamp);
         }
 



More information about the Xfce4-commits mailing list