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

Olivier Fourdan olivier at xfce.org
Sun Dec 10 22:48:55 CET 2006


Author: olivier
Date: 2006-12-10 21:48:55 +0000 (Sun, 10 Dec 2006)
New Revision: 24076

Modified:
   xfwm4/trunk/src/events.c
   xfwm4/trunk/src/focus.c
Log:
Fix demands attention being activated when it shouldn't, add more traces

Modified: xfwm4/trunk/src/events.c
===================================================================
--- xfwm4/trunk/src/events.c	2006-12-10 20:56:16 UTC (rev 24075)
+++ xfwm4/trunk/src/events.c	2006-12-10 21:48:55 UTC (rev 24076)
@@ -1426,15 +1426,19 @@
         if ((ev->value_mask & CWStackMode) && (wc.stack_mode == Above) && (wc.sibling == None))
         {
             ev->value_mask &= ~CWStackMode;
-            if (screen_info->params->prevent_focus_stealing)
+            if (c != clientGetLastRaise (screen_info))
             {
-                FLAG_SET (c->flags, CLIENT_FLAG_DEMANDS_ATTENTION);
-                clientSetNetState (c);
+                if (screen_info->params->prevent_focus_stealing)
+                {
+                    TRACE ("Setting WM_STATE_DEMANDS_ATTENTION flag on \"%s\" (0x%lx)", c->name, c->window); 
+                    FLAG_SET (c->flags, CLIENT_FLAG_DEMANDS_ATTENTION);
+                    clientSetNetState (c);
+                }
+                else
+                {
+                    clientActivate (c, myDisplayGetCurrentTime(display_info));
+                }
             }
-            else
-            {
-                clientActivate (c, myDisplayGetCurrentTime(display_info));
-            }
         }
         clientConfigure (c, &wc, ev->value_mask, (constrained ? CFG_CONSTRAINED : 0) | CFG_REQUEST);
     }
@@ -1614,7 +1618,7 @@
 handleFocusIn (DisplayInfo *display_info, XFocusChangeEvent * ev)
 {
     ScreenInfo *screen_info;
-    Client *c, *user_focus;
+    Client *c, *user_focus, *current_focus;
 
     /* See http://rfc-ref.org/RFC-TEXTS/1013/chapter12.html for details */
 
@@ -1679,9 +1683,10 @@
 
     c = myDisplayGetClientFromWindow (display_info, ev->window, ANY);
     user_focus = clientGetUserFocus ();
+    current_focus = clientGetFocus ();
 
     TRACE ("FocusIn on window (0x%lx)", ev->window);
-    if (c)
+    if ((c) && (c != current_focus))
     {
         TRACE ("focus set to \"%s\" (0x%lx)", c->name, c->window);
 
@@ -1701,6 +1706,7 @@
              */
             if (screen_info->params->prevent_focus_stealing)
             {
+                TRACE ("Setting WM_STATE_DEMANDS_ATTENTION flag on \"%s\" (0x%lx)", c->name, c->window); 
                 FLAG_SET (c->flags, CLIENT_FLAG_DEMANDS_ATTENTION);
                 clientSetNetState (c);
                 clientSetFocus (user_focus->screen_info, user_focus, getXServerTime (display_info), NO_FOCUS_FLAG);

Modified: xfwm4/trunk/src/focus.c
===================================================================
--- xfwm4/trunk/src/focus.c	2006-12-10 20:56:16 UTC (rev 24075)
+++ xfwm4/trunk/src/focus.c	2006-12-10 21:48:55 UTC (rev 24076)
@@ -184,6 +184,7 @@
 
         if (prevented && c2 && (c2->win_layer == c->win_layer))
         {
+            TRACE ("Setting WM_STATE_DEMANDS_ATTENTION flag on \"%s\" (0x%lx)", c->name, c->window); 
             FLAG_SET (c->flags, CLIENT_FLAG_DEMANDS_ATTENTION);
             clientSortRing(c);
             clientLower (c, c2->frame);
@@ -505,6 +506,7 @@
         user_focus = c;
         if (FLAG_TEST(c->flags, CLIENT_FLAG_DEMANDS_ATTENTION))
         {
+            TRACE ("Un-setting WM_STATE_DEMANDS_ATTENTION flag on \"%s\" (0x%lx)", c->name, c->window); 
             FLAG_UNSET (c->flags, CLIENT_FLAG_DEMANDS_ATTENTION);
             clientSetNetState (c);
         }



More information about the Xfce4-commits mailing list