seamonkey creates all kinds of nice transients that it then yanks from

underneath us.  validate the transient window before focussing on it.

found the hard way by jy-p
This commit is contained in:
Marco Peereboom 2010-08-11 03:15:40 +00:00
parent 838dae60f1
commit be075b908c

View file

@ -1109,9 +1109,8 @@ unmap_window(struct ws_win *win)
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);
win->s->c[SWM_S_COLOR_UNFOCUS].color);
}
void
@ -1392,7 +1391,7 @@ unfocus_win(struct ws_win *win)
return;
if (validate_ws(win->ws))
abort();
abort(); /* XXX replace with return at some point */
if (win->ws->r == NULL)
return;
@ -1457,7 +1456,8 @@ focus_win(struct ws_win *win)
return;
if (validate_ws(win->ws))
abort();
abort(); /* XXX replace with return at some point */
if (validate_win(win)) {
kill_refs(win);
return;
@ -4071,9 +4071,17 @@ focus_magic(struct ws_win *win, int do_trans)
if (win->child_trans->take_focus)
client_msg(win, takefocus);
} else {
/* 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 */