]> Dogcows Code - chaz/openbox/commitdiff
save the focus_client when falling back, so we don't actually refocus it when we...
authorDana Jansens <danakj@orodu.net>
Wed, 14 Mar 2007 15:56:59 +0000 (15:56 +0000)
committerDana Jansens <danakj@orodu.net>
Wed, 14 Mar 2007 15:56:59 +0000 (15:56 +0000)
openbox/focus.c
openbox/focus.h
openbox/screen.c

index 3fba876bf1fce4d03f4ec488f07d995fd1454d32..d18b3a1f428cfef066e9ab0f68fe914cebba5ebd 100644 (file)
@@ -248,14 +248,11 @@ static ObClient* focus_fallback_transient(ObClient *top, ObClient *old)
         return NULL;
 }
 
-ObClient* focus_fallback_target(gboolean allow_refocus)
+ObClient* focus_fallback_target(gboolean allow_refocus, ObClient *old)
 {
     GList *it;
-    ObClient *old;
     ObClient *target = NULL;
 
-    old = focus_client;
-
     if (!allow_refocus && old && old->transient_for) {
         gboolean trans = FALSE;
 
@@ -344,6 +341,10 @@ ObClient* focus_fallback_target(gboolean allow_refocus)
 void focus_fallback(gboolean allow_refocus)
 {
     ObClient *new;
+    ObClient *old;
+
+    /* save this before moving focus away to nothing */
+    old = focus_client;
 
     /* unfocus any focused clients.. they can be focused by Pointer events
        and such, and then when I try focus them, I won't get a FocusIn event
@@ -351,7 +352,7 @@ void focus_fallback(gboolean allow_refocus)
     */
     focus_set_client(NULL);
 
-    if ((new = focus_fallback_target(allow_refocus)))
+    if ((new = focus_fallback_target(allow_refocus, old)))
         client_focus(new);
 }
 
index e71cd2d7978cf67ed66fe83d4d962e4644c1a11b..200d96a57043c3bd2aca6355d7d0a3d81040923a 100644 (file)
@@ -50,7 +50,8 @@ void focus_shutdown(gboolean reconfig);
   send focus anywhere, its called by the Focus event handlers */
 void focus_set_client(struct _ObClient *client);
 
-struct _ObClient* focus_fallback_target(gboolean allow_refocus);
+struct _ObClient* focus_fallback_target(gboolean allow_refocus,
+                                        struct _ObClient *old);
 
 /*! Call this when you need to focus something! */
 void focus_fallback(gboolean allow_refocus);
index 0d4f2fb3debe21d6a3ce9e037f48492de1fca40c..70de299d35acbc0bc879e91b2a7ada6292534644 100644 (file)
@@ -463,7 +463,7 @@ void screen_set_desktop(guint num)
 
     event_ignore_queued_enters();
 
-    focus_hilite = focus_fallback_target(TRUE);
+    focus_hilite = focus_fallback_target(TRUE, focus_client);
     if (focus_hilite) {
         frame_adjust_focus(focus_hilite->frame, TRUE);
 
This page took 0.031595 seconds and 4 git commands to generate.