underneath us. validate the transient window before focussing on it.
found the hard way by jy-p
set_win_state(win, IconicState);
XUnmapWindow(display, win->id);
set_win_state(win, IconicState);
XUnmapWindow(display, win->id);
- if (win->ws->r)
- XSetWindowBorder(display, win->id,
- win->ws->r->s->c[SWM_S_COLOR_UNFOCUS].color);
+ XSetWindowBorder(display, win->id,
+ win->s->c[SWM_S_COLOR_UNFOCUS].color);
return;
if (validate_ws(win->ws))
return;
if (validate_ws(win->ws))
+ abort(); /* XXX replace with return at some point */
if (win->ws->r == NULL)
return;
if (win->ws->r == NULL)
return;
return;
if (validate_ws(win->ws))
return;
if (validate_ws(win->ws))
+ abort(); /* XXX replace with return at some point */
+
if (validate_win(win)) {
kill_refs(win);
return;
if (validate_win(win)) {
kill_refs(win);
return;
/* if in max_stack try harder */
if (ws->cur_layout->flags & SWM_L_FOCUSPREV) {
/* if in max_stack try harder */
if (ws->cur_layout->flags & SWM_L_FOCUSPREV) {
- if (cur_focus != ws->focus_prev)
- winfocus = ws->focus_prev;
- else if (cur_focus != ws->focus)
- winfocus = ws->focus;
+ if (cur_focus != ws->focus_prev)
+ winfocus = ws->focus_prev;
+ else if (cur_focus != ws->focus)
+ winfocus = ws->focus;
else
winfocus = TAILQ_PREV(win, ws_win_list, entry);
if (winfocus)
else
winfocus = TAILQ_PREV(win, ws_win_list, entry);
if (winfocus)
winlostfocus = cur_focus;
switch (args->id) {
winlostfocus = cur_focus;
switch (args->id) {
- case SWM_ARG_ID_FOCUSPREV:
+ case SWM_ARG_ID_FOCUSPREV:
winfocus = TAILQ_PREV(cur_focus, ws_win_list, entry);
if (winfocus == NULL)
winfocus = TAILQ_LAST(wl, ws_win_list);
winfocus = TAILQ_PREV(cur_focus, ws_win_list, entry);
if (winfocus == NULL)
winfocus = TAILQ_LAST(wl, ws_win_list);
if (win->child_trans->take_focus)
client_msg(win, takefocus);
} else {
if (win->child_trans->take_focus)
client_msg(win, takefocus);
} else {
- focus_win(win->child_trans);
- if (win->child_trans->take_focus)
- client_msg(win->child_trans, takefocus);
+ /* make sure transient hasn't dissapeared */
+ if (validate_win(win->child_trans) == 0) {
+ focus_win(win->child_trans);
+ if (win->child_trans->take_focus)
+ client_msg(win->child_trans, takefocus);
+ } else {
+ win->child_trans = NULL;
+ focus_win(win);
+ if (win->take_focus)
+ client_msg(win, takefocus);
+ }
}
} else {
/* regular focus */
}
} else {
/* regular focus */