/* stop focus cycling if the given client is a valid focus target,
and so the cycling is being disrupted */
if (focus_cycle_target && ifclient &&
- focus_valid_target(ifclient, TRUE,
- focus_cycle_iconic_windows,
- focus_cycle_all_desktops,
- focus_cycle_dock_windows,
- focus_cycle_desktop_windows,
- FALSE))
+ (ifclient == focus_cycle_target ||
+ focus_cycle_popup_is_showing(ifclient)))
{
focus_cycle(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,TRUE);
focus_directional_cycle(0, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE);
{
icon_popup_hide(single_popup);
}
+
+gboolean focus_cycle_popup_is_showing(ObClient *client)
+{
+ if (popup.mapped) {
+ GList *it;
+
+ for (it = popup.targets; it; it = g_list_next(it)) {
+ ObFocusCyclePopupTarget *t = it->data;
+ if (t->client == client)
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
gboolean desktop_windows);
void focus_cycle_popup_single_hide();
+/*! Returns TRUE if the popup is showing the client, otherwise FALSE. */
+gboolean focus_cycle_popup_is_showing(struct _ObClient *client);
+
#endif
#include "frame.h"
#include "event.h"
#include "focus.h"
+#include "focus_cycle.h"
#include "popup.h"
#include "extensions.h"
#include "render/render.h"
for (it = g_list_last(stacking_list); it; it = g_list_previous(it)) {
if (WINDOW_IS_CLIENT(it->data)) {
ObClient *c = it->data;
- if (client_hide(c) && c == focus_client) {
- /* c was focused and we didn't do fallback clearly so make sure
- openbox doesnt still consider the window focused.
- this happens when using NextWindow with allDesktops, since
- it doesnt want to move focus on desktop change, but the
- focus is not going to stay with the current window, which
- has now disappeared */
- focus_set_client(NULL);
+ if (client_hide(c)) {
+ /* in the middle of cycling..? kill it. */
+ focus_cycle_stop(c);
+
+ if (c == focus_client) {
+ /* c was focused and we didn't do fallback clearly so make
+ sure openbox doesnt still consider the window focused.
+ this happens when using NextWindow with allDesktops,
+ since it doesnt want to move focus on desktop change,
+ but the focus is not going to stay with the current
+ window, which has now disappeared.
+ only do this if the client was actually hidden,
+ otherwise it can keep focus. */
+ focus_set_client(NULL);
+ }
}
}
}