Author: olivier
Date: 2006-12-22 20:21:05 +0000 (Fri, 22 Dec 2006)
New Revision: 24169

Modified:
   xfwm4/trunk/src/client.h
   xfwm4/trunk/src/focus.c
Log:
Focus the internal fallback window when focus is transfered to a window that 
doesn't have InputHint set but still use WM_PROTOCOLS_TAKE_FOCUS (ie, there is 
no way for the window manager to tell whether or not the client will accept 
focus in the end since focus is set by the client alone through the 'take 
focus' mechanism) - Fix bug #1853 without breaking #2410

Modified: xfwm4/trunk/src/client.h
===================================================================
--- xfwm4/trunk/src/client.h    2006-12-22 18:52:40 UTC (rev 24168)
+++ xfwm4/trunk/src/client.h    2006-12-22 20:21:05 UTC (rev 24169)
@@ -198,10 +198,6 @@
 #define CLIENT_CAN_STICK_WINDOW(c)      (!(c->transient_for) && \
                                          FLAG_TEST(c->xfwm_flags, 
XFWM_FLAG_HAS_STICK))
 
-#define HINTS_ACCEPT_INPUT(wmhints)     (!(wmhints) || \
-                                         ((wmhints) && !(wmhints->flags & 
InputHint)) || \
-                                         ((wmhints) && (wmhints->flags & 
InputHint) && (wmhints->input)))
-
 typedef enum
 {
     UNSET = 0,

Modified: xfwm4/trunk/src/focus.c
===================================================================
--- xfwm4/trunk/src/focus.c     2006-12-22 18:52:40 UTC (rev 24168)
+++ xfwm4/trunk/src/focus.c     2006-12-22 20:21:05 UTC (rev 24169)
@@ -540,6 +540,12 @@
             }
             clientUpdateOpacity (screen_info, c);
         }
+        else if (!client_focus)
+        {
+            /* Hack to prevent loosing focus when all remaining windows won't 
accept focus, see bug #1853 */
+            XSetInputFocus (myScreenGetXDisplay (screen_info), 
screen_info->xfwm4_win, RevertToPointerRoot, timestamp);
+        }
+
         if (FLAG_TEST(c->wm_flags, WM_FLAG_TAKEFOCUS))
         {
             pending_focus = c;

_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to