From 97f08901d628138426b473c78e8a76f2852136d8 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sun, 20 Jan 2008 17:05:34 +0100 Subject: [PATCH] call restack() only when focus()ing --- client.c | 11 ++--------- event.c | 1 - layout.c | 1 - mouse.c | 3 --- 4 files changed, 2 insertions(+), 14 deletions(-) diff --git a/client.c b/client.c index 3cce8888e..770fcbe21 100644 --- a/client.c +++ b/client.c @@ -210,6 +210,7 @@ focus(Client *c, Bool selscreen, int screen) window_settrans(globalconf.focus->client->win, globalconf.screens[screen].opacity_unfocused); window_settrans(globalconf.focus->client->win, -1); + restack(screen); } else XSetInputFocus(globalconf.display, @@ -308,6 +309,7 @@ client_manage(Window w, XWindowAttributes *wa, int screen) } XSelectInput(globalconf.display, w, StructureNotifyMask | PropertyChangeMask | EnterWindowMask); + window_grabbuttons(phys_screen, c->win, False, True); /* handle xshape */ if(globalconf.have_shape) @@ -831,20 +833,17 @@ client_maximize(Client *c, Area geometry) if(get_current_layout(c->screen)->arrange != layout_floating) client_setfloating(c, True); client_resize(c, geometry, False); - restack(c->screen); widget_invalidate_cache(c->screen, WIDGET_CACHE_CLIENTS); } else if(c->wasfloating) { client_setfloating(c, True); client_resize(c, c->m_geometry, False); - restack(c->screen); widget_invalidate_cache(c->screen, WIDGET_CACHE_CLIENTS); } else if(get_current_layout(c->screen)->arrange == layout_floating) { client_resize(c, c->m_geometry, False); - restack(c->screen); widget_invalidate_cache(c->screen, WIDGET_CACHE_CLIENTS); } else @@ -958,10 +957,7 @@ uicb_client_focusnext(int screen, char *arg __attribute__ ((unused))) if(!c) for(c = globalconf.clients; c && (c->skip || !client_isvisible(c, screen)); c = c->next); if(c) - { focus(c, True, screen); - restack(screen); - } } /** Send focus to previous client in stack @@ -975,10 +971,7 @@ uicb_client_focusprev(int screen, char *arg __attribute__ ((unused))) Client *prev; if((prev = client_find_prev_visible(globalconf.focus->client))) - { focus(prev, True, screen); - restack(screen); - } } /** Toggle floating state of a client diff --git a/event.c b/event.c index 81cd70b99..9ece20889 100644 --- a/event.c +++ b/event.c @@ -113,7 +113,6 @@ handle_event_buttonpress(XEvent *e) if(CLEANMASK(ev->state) == NoSymbol && ev->button == Button1) { - restack(c->screen); XAllowEvents(globalconf.display, ReplayPointer, CurrentTime); window_grabbuttons(get_phys_screen(c->screen), c->win, True, True); } diff --git a/layout.c b/layout.c index a625f1c3e..17793ae25 100644 --- a/layout.c +++ b/layout.c @@ -76,7 +76,6 @@ arrange(int screen) window_grabbuttons(c->screen, c->win, False, False); p_delete(&curtags); - restack(screen); /* reset status */ globalconf.screens[screen].need_arrange = False; diff --git a/mouse.c b/mouse.c index 0f5617a2f..61bd5ff21 100644 --- a/mouse.c +++ b/mouse.c @@ -61,8 +61,6 @@ uicb_client_movemouse(int screen, char *arg __attribute__ ((unused))) client_setfloating(c, True); } - restack(screen); - area = get_screen_area(c->screen, globalconf.screens[screen].statusbar, &globalconf.screens[screen].padding); @@ -137,7 +135,6 @@ uicb_client_resizemouse(int screen, char *arg __attribute__ ((unused))) { if(layout->arrange == layout_floating || c->isfloating) { - restack(screen); ocx = c->geometry.x; ocy = c->geometry.y; c->ismax = False;