Author: olivier
Date: 2008-11-27 13:27:18 +0000 (Thu, 27 Nov 2008)
New Revision: 28924

Modified:
   xfwm4/trunk/ChangeLog
   xfwm4/trunk/src/focus.c
   xfwm4/trunk/src/focus.h
Log:
        * src/focus.c, src/focus.h: Only focus the fallback window when 
          transitioning focus from a destroy or unmap (Should fix Bug #4652)
          Do some small cleanup, remove older code ifdef'ed.
        * src/moveresize.c: Work around a problem affecting the use of 
          to check the value for each iteration.

Modified: xfwm4/trunk/ChangeLog
===================================================================
--- xfwm4/trunk/ChangeLog       2008-11-27 12:26:04 UTC (rev 28923)
+++ xfwm4/trunk/ChangeLog       2008-11-27 13:27:18 UTC (rev 28924)
@@ -1,3 +1,9 @@
+2008-11-27  olivier
+
+       * src/focus.c, src/focus.h: Only focus the fallback window when 
+         transitioning focus from a destroy or unmap (Should fix Bug #4652)
+         Do some small cleanup, remove older code ifdef'ed.
+
 2008-11-25  olivier
 
        * themes/daloa: Enlarge active zone of buttons
@@ -8,13 +14,13 @@
 
 2008-11-20  olivier
 
-       * src/moveresize.c: Work arround a problem affecting the use of 
+       * src/moveresize.c: Work around a problem affecting the use of 
          the "Super" key as modifier for moving windows (Bug #4632)
 
 2008-11-19  olivier
 
        * settings-dialogs/workspace-settings.c: Trivial optimization, no need 
-         to check the value for eatch iteration.
+         to check the value for each iteration.
 
 2008-11-18  olivier
 

Modified: xfwm4/trunk/src/focus.c
===================================================================
--- xfwm4/trunk/src/focus.c     2008-11-27 12:26:04 UTC (rev 28923)
+++ xfwm4/trunk/src/focus.c     2008-11-27 13:27:18 UTC (rev 28924)
@@ -323,12 +323,12 @@
     new_focus = NULL;
     current_focus = client_focus;
     c2 = NULL;
-#if 1
+
     if (pending_focus)
     {
         current_focus = pending_focus;
     }
-#endif
+
     if ((c || current_focus) && (c != current_focus))
     {
         return;
@@ -341,39 +341,7 @@
 
     display_info = screen_info->display_info;
     top_most = clientGetTopMostFocusable (screen_info, look_in_layer, 
exclude_list);
-#if 0
-    if (screen_info->params->click_to_focus)
-    {
-        if (c)
-        {
-            if (clientIsModal (c))
-            {
-                /* 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...
-                 */
-                c2 = clientGetTransient (c);
-                if (c2 && FLAG_TEST(c2->xfwm_flags, XFWM_FLAG_VISIBLE))
-                {
-                    new_focus = c2;
-                    /* Usability: raise the parent, to grab user's attention */
-                    clientRaise (c2, None);
-                }
-            }
-            else
-            {
-                c2 = clientGetNext (c, 0);
-                if ((c2) && (c2->win_layer >= c->win_layer))
-                {
-                    new_focus = c2;
-                }
-            }
-        }
-    }
-    else
-#endif
+
     if (!(screen_info->params->click_to_focus) &&
         XQueryPointer (myScreenGetXDisplay (screen_info), screen_info->xroot, 
&dr, &window, &rx, &ry, &wx, &wy, &mask))
     {
@@ -385,7 +353,7 @@
     }
     clientSetFocus (screen_info, new_focus,
                     myDisplayGetCurrentTime (display_info),
-                    FOCUS_IGNORE_MODAL | FOCUS_FORCE);
+                    FOCUS_IGNORE_MODAL | FOCUS_FORCE | FOCUS_TRANSITION);
 }
 
 gboolean
@@ -604,7 +572,7 @@
                 XSetInputFocus (myScreenGetXDisplay (screen_info), c->window, 
RevertToPointerRoot, timestamp);
             }
         }
-        else
+        else if (flags & FOCUS_TRANSITION)
         {
             /*
              * If we are relying only on the client application to take focus, 
we need to set the focus

Modified: xfwm4/trunk/src/focus.h
===================================================================
--- xfwm4/trunk/src/focus.h     2008-11-27 12:26:04 UTC (rev 28923)
+++ xfwm4/trunk/src/focus.h     2008-11-27 13:27:18 UTC (rev 28924)
@@ -38,6 +38,7 @@
 #define FOCUS_SORT                      (1<<0)
 #define FOCUS_IGNORE_MODAL              (1<<1)
 #define FOCUS_FORCE                     (1<<2)
+#define FOCUS_TRANSITION                (1<<3)
 
 void                     clientFocusTop                         (ScreenInfo *,
                                                                  int,

_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to