prefix and capitalize the ObFocusFallbackType enum
This commit is contained in:
parent
5c2e4cced4
commit
59f318e897
5 changed files with 20 additions and 15 deletions
|
@ -168,9 +168,9 @@ void client_manage_all()
|
|||
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 @@ void client_unfocus(ObClient *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)
|
||||
|
|
|
@ -432,7 +432,7 @@ static gboolean event_ignore(XEvent *e, ObClient *client)
|
|||
g_message("no valid FocusIn and no FocusOut events found, "
|
||||
"falling back");
|
||||
#endif
|
||||
focus_fallback(Fallback_NoFocus);
|
||||
focus_fallback(OB_FOCUS_FALLBACK_NOFOCUS);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -172,7 +172,7 @@ static gboolean focus_fallback_transient(ObClient *top, ObClient *old)
|
|||
return client_focus(target);
|
||||
}
|
||||
|
||||
void focus_fallback(FallbackType type)
|
||||
void focus_fallback(ObFocusFallbackType type)
|
||||
{
|
||||
GList *it;
|
||||
ObClient *old = NULL;
|
||||
|
@ -185,13 +185,13 @@ void focus_fallback(FallbackType type)
|
|||
*/
|
||||
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 @@ void focus_fallback(FallbackType type)
|
|||
}
|
||||
|
||||
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
|
||||
|
|
|
@ -23,13 +23,14 @@ void focus_shutdown();
|
|||
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. */
|
||||
|
|
|
@ -346,9 +346,13 @@ void screen_set_desktop(guint num)
|
|||
/* 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 @@ void screen_show_desktop(gboolean show)
|
|||
client_focus(it->data))
|
||||
break;
|
||||
} else {
|
||||
focus_fallback(Fallback_NoFocus);
|
||||
focus_fallback(OB_FOCUS_FALLBACK_NOFOCUS);
|
||||
}
|
||||
|
||||
show = !!show; /* make it boolean */
|
||||
|
|
Loading…
Reference in a new issue