all repos — openbox @ 59f318e897a301a40fb46fadbc4b825ccf86c0ba

openbox fork - make it a bit more like ryudo

prefix and capitalize the ObFocusFallbackType enum
Dana Jansens danakj@orodu.net
commit

59f318e897a301a40fb46fadbc4b825ccf86c0ba

parent

5c2e4cced43e59fbe2bd974aabde9d0b1c9f5748

5 files changed, 20 insertions(+), 15 deletions(-)

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

@@ -168,9 +168,9 @@ active = g_hash_table_lookup(window_map, &startup_active);

if (active) { g_assert(WINDOW_IS_CLIENT(active)); if (!client_focus(WINDOW_AS_CLIENT(active))) - focus_fallback(Fallback_NoFocus); + focus_fallback(OB_FOCUS_FALLBACK_NOFOCUS); } else - focus_fallback(Fallback_NoFocus); + focus_fallback(OB_FOCUS_FALLBACK_NOFOCUS); } }

@@ -2418,7 +2418,7 @@ g_assert(focus_client == self);

#ifdef DEBUG_FOCUS g_message("client_unfocus for %lx", self->window); #endif - focus_fallback(Fallback_Unfocusing); + focus_fallback(OB_FOCUS_FALLBACK_UNFOCUSING); } void client_activate(ObClient *self)
M openbox/event.copenbox/event.c

@@ -432,7 +432,7 @@ #ifdef DEBUG_FOCUS

g_message("no valid FocusIn and no FocusOut events found, " "falling back"); #endif - focus_fallback(Fallback_NoFocus); + focus_fallback(OB_FOCUS_FALLBACK_NOFOCUS); } } break;
M openbox/focus.copenbox/focus.c

@@ -172,7 +172,7 @@ }

return client_focus(target); } -void focus_fallback(FallbackType type) +void focus_fallback(ObFocusFallbackType type) { GList *it; ObClient *old = NULL;

@@ -185,13 +185,13 @@ at all for them.

*/ focus_set_client(NULL); - if (!(type == Fallback_Desktop ? + if (!(type == OB_FOCUS_FALLBACK_DESKTOP ? config_focus_last_on_desktop : config_focus_last)) { if (config_focus_follow) focus_under_pointer(); return; } - if (type == Fallback_Unfocusing && old) { + if (type == OB_FOCUS_FALLBACK_UNFOCUSING && old) { /* try for transient relations */ if (old->transient_for) { if (old->transient_for == OB_TRAN_GROUP) {

@@ -226,7 +226,7 @@ }

} for (it = focus_order[screen_desktop]; it != NULL; it = it->next) - if (type != Fallback_Unfocusing || it->data != old) + if (type != OB_FOCUS_FALLBACK_UNFOCUSING || it->data != old) if (client_normal(it->data) && /* dont fall back to 'anonymous' fullscreen windows. theres no checks for this is in transient/group fallbacks, so they can
M openbox/focus.hopenbox/focus.h

@@ -23,13 +23,14 @@ send focus anywhere, its called by the Focus event handlers */

void focus_set_client(struct _ObClient *client); typedef enum { - Fallback_Desktop, /* switching desktops */ - Fallback_Unfocusing, /* forcefully remove focus from the current window */ - Fallback_NoFocus /* nothing has focus for some reason */ -} FallbackType; + OB_FOCUS_FALLBACK_DESKTOP, /*!< switching desktops */ + OB_FOCUS_FALLBACK_UNFOCUSING, /*!< forcefully remove focus from the + current window */ + OB_FOCUS_FALLBACK_NOFOCUS /*!< nothing has focus for some reason */ +} ObFocusFallbackType; /*! Call this when you need to focus something! */ -void focus_fallback(FallbackType type); +void focus_fallback(ObFocusFallbackType type); /*! Cycle focus amongst windows Returns the _ObClient to which focus has been cycled, or NULL if none. */
M openbox/screen.copenbox/screen.c

@@ -346,9 +346,13 @@

/* focus the last focused window on the desktop, and ignore enter events from the switch so it doesnt mess with the focus */ while (XCheckTypedEvent(ob_display, EnterNotify, &e)); +#ifdef DEBUG_FOCUS g_message("switch fallback"); - focus_fallback(Fallback_Desktop); +#endif + focus_fallback(OB_FOCUS_FALLBACK_DESKTOP); +#ifdef DEBUG_FOCUS g_message("/switch fallback"); +#endif dispatch_ob(Event_Ob_Desktop, num, old); }

@@ -489,7 +493,7 @@ if (((ObClient*)it->data)->type == OB_CLIENT_TYPE_DESKTOP &&

client_focus(it->data)) break; } else { - focus_fallback(Fallback_NoFocus); + focus_fallback(OB_FOCUS_FALLBACK_NOFOCUS); } show = !!show; /* make it boolean */