all repos — openbox @ a9175a8a324deb6d1b7e717fb77fbc96204c7540

openbox fork - make it a bit more like ryudo

save the focus_client when falling back, so we don't actually refocus it when we don't want to.
Dana Jansens danakj@orodu.net
commit

a9175a8a324deb6d1b7e717fb77fbc96204c7540

parent

adc5675823de8e3bbe94a1419b04103c6f845dad

3 files changed, 9 insertions(+), 7 deletions(-)

jump to
M openbox/focus.copenbox/focus.c

@@ -248,13 +248,10 @@ else

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 @@

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 @@ at all for them.

*/ focus_set_client(NULL); - if ((new = focus_fallback_target(allow_refocus))) + if ((new = focus_fallback_target(allow_refocus, old))) client_focus(new); }
M openbox/focus.hopenbox/focus.h

@@ -50,7 +50,8 @@ /*! Specify which client is currently focused, this doesn't actually

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);
M openbox/screen.copenbox/screen.c

@@ -463,7 +463,7 @@ }

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);