summaryrefslogtreecommitdiff
path: root/openbox/focus.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-03-14 15:56:59 +0000
committerDana Jansens <danakj@orodu.net>2007-03-14 15:56:59 +0000
commita9175a8a324deb6d1b7e717fb77fbc96204c7540 (patch)
tree9ca3226f81be1f731645c1de3a0733b00f655d26 /openbox/focus.c
parentadc5675823de8e3bbe94a1419b04103c6f845dad (diff)
save the focus_client when falling back, so we don't actually refocus it when we don't want to.
Diffstat (limited to 'openbox/focus.c')
-rw-r--r--openbox/focus.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/openbox/focus.c b/openbox/focus.c
index 3fba876b..d18b3a1f 100644
--- a/openbox/focus.c
+++ b/openbox/focus.c
@@ -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);
}