screen: only untag if client had a screen

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-09-22 15:51:55 +02:00
parent d4e6411971
commit 69fa11af8f
1 changed files with 4 additions and 3 deletions

View File

@ -273,9 +273,10 @@ screen_client_moveto(client_t *c, screen_t *new_screen, bool doresize)
if(c->titlebar) if(c->titlebar)
c->titlebar->screen = new_screen; c->titlebar->screen = new_screen;
/* remove old tags */ /* If client was on a screen, remove old tags */
foreach(old_tag, old_screen->tags) if(old_screen)
untag_client(c, *old_tag); foreach(old_tag, old_screen->tags)
untag_client(c, *old_tag);
if(!doresize) if(!doresize)
{ {