Bugfix: Don’t break focus stack when inplace restarting with fullscreen windows (Thanks mike)

This commit is contained in:
Michael Stapelberg 2011-06-03 01:48:55 +02:00
parent 1585d942ea
commit 58e02e84e2

View File

@ -264,9 +264,14 @@ void manage_window(xcb_window_t window, xcb_get_window_attributes_cookie_t cooki
* focused (fullscreen) con. This way, the new container will be * focused (fullscreen) con. This way, the new container will be
* focused after we return from fullscreen mode */ * focused after we return from fullscreen mode */
Con *first = TAILQ_FIRST(&(nc->parent->focus_head)); Con *first = TAILQ_FIRST(&(nc->parent->focus_head));
if (first != nc) {
/* We only modify the focus stack if the container is not already
* the first one. This can happen when existing containers swallow
* new windows, for example when restarting. */
TAILQ_REMOVE(&(nc->parent->focus_head), nc, focused); TAILQ_REMOVE(&(nc->parent->focus_head), nc, focused);
TAILQ_INSERT_AFTER(&(nc->parent->focus_head), first, nc, focused); TAILQ_INSERT_AFTER(&(nc->parent->focus_head), first, nc, focused);
} }
}
/* set floating if necessary */ /* set floating if necessary */
bool want_floating = false; bool want_floating = false;