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);
}
}
#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)
g_message("no valid FocusIn and no FocusOut events found, "
"falling back");
#endif
- focus_fallback(Fallback_NoFocus);
+ focus_fallback(OB_FOCUS_FALLBACK_NOFOCUS);
}
}
break;
return client_focus(target);
}
-void focus_fallback(FallbackType type)
+void focus_fallback(ObFocusFallbackType type)
{
GList *it;
ObClient *old = NULL;
*/
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) {
}
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
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. */
/* 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);
}
client_focus(it->data))
break;
} else {
- focus_fallback(Fallback_NoFocus);
+ focus_fallback(OB_FOCUS_FALLBACK_NOFOCUS);
}
show = !!show; /* make it boolean */