summaryrefslogtreecommitdiff
path: root/openbox
diff options
context:
space:
mode:
Diffstat (limited to 'openbox')
-rw-r--r--openbox/client.c6
-rw-r--r--openbox/event.c2
-rw-r--r--openbox/focus.c8
-rw-r--r--openbox/focus.h11
-rw-r--r--openbox/screen.c8
5 files changed, 20 insertions, 15 deletions
diff --git a/openbox/client.c b/openbox/client.c
index 1fd91f60..141bfcb9 100644
--- a/openbox/client.c
+++ b/openbox/client.c
@@ -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)
diff --git a/openbox/event.c b/openbox/event.c
index 8acca386..7a1f66e9 100644
--- a/openbox/event.c
+++ b/openbox/event.c
@@ -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;
diff --git a/openbox/focus.c b/openbox/focus.c
index b64d3e00..f330e527 100644
--- a/openbox/focus.c
+++ b/openbox/focus.c
@@ -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
diff --git a/openbox/focus.h b/openbox/focus.h
index d917367b..a7f70a0e 100644
--- a/openbox/focus.h
+++ b/openbox/focus.h
@@ -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. */
diff --git a/openbox/screen.c b/openbox/screen.c
index c9b05a51..e2e141dd 100644
--- a/openbox/screen.c
+++ b/openbox/screen.c
@@ -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 */