all repos — openbox @ 85a1a0cfb3e6f57b37d7a7b83132698b2d6cdee3

openbox fork - make it a bit more like ryudo

don't validate inside client_focus. instead, validate before you call it!
Dana Jansens danakj@orodu.net
commit

85a1a0cfb3e6f57b37d7a7b83132698b2d6cdee3

parent

6b7cc88c9d4ae2019f3b8fcd300dd3069f2bc680

5 files changed, 14 insertions(+), 7 deletions(-)

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

@@ -1164,7 +1164,8 @@ /* if using focus_delay, stop the timer now so that focus doesn't go

moving on us */ event_halt_focus_delay(); - client_focus(data->client.any.c); + if (client_validate(data->client.any.c)) + client_focus(data->client.any.c); } }
M openbox/client.copenbox/client.c

@@ -2937,8 +2937,10 @@ {

/* choose the correct target */ self = client_focus_target(self); +#if 0 if (!client_validate(self)) return FALSE; +#endif if (!client_can_focus(self)) { if (!self->frame->visible) {
M openbox/client.hopenbox/client.h

@@ -472,7 +472,9 @@ /*! Returns what client_focus would return if passed the same client, but

without focusing it or modifying the focus order lists. */ gboolean client_can_focus(ObClient *self); -/*! Attempt to focus the client window */ +/*! Attempt to focus the client window + NOTE: You should validate the client before calling this !! (client_validate) +*/ gboolean client_focus(ObClient *self); /*! Remove focus from the client window */
M openbox/event.copenbox/event.c

@@ -433,7 +433,7 @@ break;

} } -#if 0 /* focus debugging stuff */ +#if 1 /* focus debugging stuff */ if (e->type == FocusIn || e->type == FocusOut) { gint mode = e->xfocus.mode; gint detail = e->xfocus.detail;

@@ -1287,9 +1287,11 @@ {

ObClient *c = data; if (focus_client != c) { - client_focus(c); - if (config_focus_raise) - client_raise(c); + if (client_validate(c)) { + client_focus(c); + if (config_focus_raise) + client_raise(c); + } } return FALSE; /* no repeat */ }
M openbox/screen.copenbox/screen.c

@@ -894,7 +894,7 @@ if (show) {

/* focus desktop */ for (it = focus_order[screen_desktop]; it; it = g_list_next(it)) if (((ObClient*)it->data)->type == OB_CLIENT_TYPE_DESKTOP && - client_focus(it->data)) + client_validate(it->data) && client_focus(it->data)) break; } else { focus_fallback(OB_FOCUS_FALLBACK_NOFOCUS);