focus_win(winfocus);
}
+ ignore_enter = 0;
bar_update();
}
ignore_enter = 1;
stack();
/* make sure we see the parent window */
- if (winfocus->transient) {
- parent = find_window(winfocus->transient);
+ if (winfocus) {
+ if (winfocus->transient)
+ parent = find_window(winfocus->transient);
if (parent)
focus_win(parent);
+ focus_win(winfocus);
}
- focus_win(winfocus);
ignore_enter = 0;
}
}
}
}
-
+ ignore_enter = 1;
unmanage_window(win);
stack();
if (winfocus)
focus_win(winfocus);
+ ignore_enter = 0;
}
SWM_EV_EPILOGUE(display);
if (QLength(display))
return;
- if ((win = find_window(ev->window)) != NULL)
+ if ((win = find_window(ev->window)) != NULL) {
+ if (win->ws->focus == win)
+ return;
focus_win(win);
+ }
}
void
ws = win->ws;
/* if we are max_stack try harder to focus on something */
- if (ws->cur_layout->flags & SWM_L_FOCUSPREV)
- if (win != ws->focus && win != ws->focus_prev)
+ if (ws->cur_layout->flags & SWM_L_FOCUSPREV) {
+ if (win->transient)
+ winfocus = find_window(win->transient);
+ else if (win != ws->focus && win != ws->focus_prev)
winfocus = ws->focus_prev;
+ }
/* normal and fallback if haven't found anything to focus on */
if (winfocus == NULL) {
/* trash window and refocus */
unmanage_window(win);
+ ignore_enter = 1;
stack();
focus_win(winfocus);
+ ignore_enter = 0;
}
done: