From 1d6c07c24be25b2de4d36dfb0cc6e5f2d3518bf8 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sat, 12 May 2007 00:54:44 +0000 Subject: try catch weird racey corner case where we try fallback to a window but it unmaps as we do so, so focus ends up going to nowhere --- openbox/focus.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'openbox/focus.c') diff --git a/openbox/focus.c b/openbox/focus.c index a4d3f9f2..393ec98e 100644 --- a/openbox/focus.c +++ b/openbox/focus.c @@ -255,7 +255,7 @@ ObClient* focus_fallback_target(gboolean allow_refocus, ObClient *old) return desktop; } -void focus_fallback(gboolean allow_refocus) +ObClient* focus_fallback(gboolean allow_refocus) { ObClient *new; ObClient *old = focus_client; @@ -266,8 +266,11 @@ void focus_fallback(gboolean allow_refocus) */ focus_nothing(); - if ((new = focus_fallback_target(allow_refocus, old))) + if ((new = focus_fallback_target(allow_refocus, old))) { client_focus(new); + return new; + } else + return NULL; } void focus_nothing() -- cgit v1.2.3