From e1e12f4c0add49d2ee97bef6bbc0fbca1cb8966d Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sat, 28 Jun 2008 11:47:29 +0200 Subject: [PATCH] event: only map if the client is visible Signed-off-by: Julien Danjou --- event.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/event.c b/event.c index a3355b90..da3b5763 100644 --- a/event.c +++ b/event.c @@ -445,17 +445,12 @@ event_handle_maprequest(void *data __attribute__ ((unused)), } else if((c = client_getbywin(ev->window))) { - tag_array_t *tags = &globalconf.screens[c->screen].tags; - - xcb_map_window(globalconf.connection, ev->window); - - /* add tags currently shown */ - for(int i = 0; i < tags->len; i++) - if(tags->tab[i]->selected) - tag_client(c, tags->tab[i]); - - /* it will be raised, so just update ourself */ - client_raise(c); + if(client_isvisible(c, c->screen)) + { + xcb_map_window(globalconf.connection, ev->window); + /* it will be raised, so just update ourself */ + client_raise(c); + } } else {