all repos — openbox @ b8fded742abad3c43c708ee935f5b58237170a01

openbox fork - make it a bit more like ryudo

make focuslast only apply to switching desktops, like 3.3.1
Dana Jansens danakj@orodu.net
commit

b8fded742abad3c43c708ee935f5b58237170a01

parent

568ca95bc222b1c694fbd77ce417fd04630846ae

5 files changed, 16 insertions(+), 11 deletions(-)

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

@@ -1311,7 +1311,7 @@

void action_unfocus (union ActionData *data) { if (data->client.any.c == focus_client) - focus_fallback(FALSE); + focus_fallback(FALSE, FALSE); } void action_iconify(union ActionData *data)
M openbox/event.copenbox/event.c

@@ -516,7 +516,7 @@ worry about focusing an invalid window

*/ if (!focus_left_screen) - focus_fallback(TRUE); + focus_fallback(TRUE, FALSE); } } else if (!client)

@@ -570,7 +570,7 @@ that isn't a client. */

ob_debug_type(OB_DEBUG_FOCUS, "Focus went to an unmanaged window 0x%x !\n", ce.xfocus.window); - focus_fallback(TRUE); + focus_fallback(TRUE, FALSE); } }
M openbox/focus.copenbox/focus.c

@@ -95,13 +95,15 @@ net_active_window, window, active);

} } -static ObClient* focus_fallback_target(gboolean allow_refocus, ObClient *old) +static ObClient* focus_fallback_target(gboolean allow_refocus, + gboolean allow_pointer, + ObClient *old) { GList *it; ObClient *c; ob_debug_type(OB_DEBUG_FOCUS, "trying pointer stuff\n"); - if (config_focus_follow && !config_focus_last) + if (allow_pointer && config_focus_follow) if ((c = client_under_pointer()) && (allow_refocus || c != old) && (client_normal(c) &&

@@ -153,7 +155,7 @@

return NULL; } -ObClient* focus_fallback(gboolean allow_refocus) +ObClient* focus_fallback(gboolean allow_refocus, gboolean allow_pointer) { ObClient *new; ObClient *old = focus_client;

@@ -163,7 +165,7 @@ and such, and then when we try focus them, we won't get a FocusIn

event at all for them. */ focus_nothing(); - new = focus_fallback_target(allow_refocus, old); + new = focus_fallback_target(allow_refocus, allow_pointer, old); return new; }
M openbox/focus.hopenbox/focus.h

@@ -44,7 +44,8 @@ /*! Focus nothing, but let keyboard events be caught. */

void focus_nothing(); /*! Call this when you need to focus something! */ -struct _ObClient* focus_fallback(gboolean allow_refocus); +struct _ObClient* focus_fallback(gboolean allow_refocus, + gboolean allow_pointer); /*! Add a new client into the focus order */ void focus_order_add_new(struct _ObClient *c);
M openbox/screen.copenbox/screen.c

@@ -539,12 +539,14 @@ focus_client->desktop == screen_desktop))

dofocus = FALSE; /* have to try focus here because when you leave an empty desktop - there is no focus out to watch for + there is no focus out to watch for. also, we have different rules + here. we always allow it to look under the mouse pointer if + config_focus_last is FALSE do this before hiding the windows so if helper windows are coming with us, they don't get hidden */ - if (dofocus && (c = focus_fallback(TRUE))) + if (dofocus && (c = focus_fallback(TRUE, !config_focus_last))) { /* only do the flicker reducing stuff ahead of time if we are going to call xsetinputfocus on the window ourselves. otherwise there is

@@ -1007,7 +1009,7 @@ }

else if (!show_only) { ObClient *c; - if ((c = focus_fallback(TRUE))) { + if ((c = focus_fallback(TRUE, FALSE))) { /* only do the flicker reducing stuff ahead of time if we are going to call xsetinputfocus on the window ourselves. otherwise there is no guarantee the window will actually take focus.. */