call restack() only when focus()ing

This commit is contained in:
Julien Danjou 2008-01-20 17:05:34 +01:00
parent d7a7ba6afe
commit 97f08901d6
4 changed files with 2 additions and 14 deletions

View File

@ -210,6 +210,7 @@ focus(Client *c, Bool selscreen, int screen)
window_settrans(globalconf.focus->client->win, window_settrans(globalconf.focus->client->win,
globalconf.screens[screen].opacity_unfocused); globalconf.screens[screen].opacity_unfocused);
window_settrans(globalconf.focus->client->win, -1); window_settrans(globalconf.focus->client->win, -1);
restack(screen);
} }
else else
XSetInputFocus(globalconf.display, XSetInputFocus(globalconf.display,
@ -308,6 +309,7 @@ client_manage(Window w, XWindowAttributes *wa, int screen)
} }
XSelectInput(globalconf.display, w, StructureNotifyMask | PropertyChangeMask | EnterWindowMask); XSelectInput(globalconf.display, w, StructureNotifyMask | PropertyChangeMask | EnterWindowMask);
window_grabbuttons(phys_screen, c->win, False, True);
/* handle xshape */ /* handle xshape */
if(globalconf.have_shape) if(globalconf.have_shape)
@ -831,20 +833,17 @@ client_maximize(Client *c, Area geometry)
if(get_current_layout(c->screen)->arrange != layout_floating) if(get_current_layout(c->screen)->arrange != layout_floating)
client_setfloating(c, True); client_setfloating(c, True);
client_resize(c, geometry, False); client_resize(c, geometry, False);
restack(c->screen);
widget_invalidate_cache(c->screen, WIDGET_CACHE_CLIENTS); widget_invalidate_cache(c->screen, WIDGET_CACHE_CLIENTS);
} }
else if(c->wasfloating) else if(c->wasfloating)
{ {
client_setfloating(c, True); client_setfloating(c, True);
client_resize(c, c->m_geometry, False); client_resize(c, c->m_geometry, False);
restack(c->screen);
widget_invalidate_cache(c->screen, WIDGET_CACHE_CLIENTS); widget_invalidate_cache(c->screen, WIDGET_CACHE_CLIENTS);
} }
else if(get_current_layout(c->screen)->arrange == layout_floating) else if(get_current_layout(c->screen)->arrange == layout_floating)
{ {
client_resize(c, c->m_geometry, False); client_resize(c, c->m_geometry, False);
restack(c->screen);
widget_invalidate_cache(c->screen, WIDGET_CACHE_CLIENTS); widget_invalidate_cache(c->screen, WIDGET_CACHE_CLIENTS);
} }
else else
@ -958,10 +957,7 @@ uicb_client_focusnext(int screen, char *arg __attribute__ ((unused)))
if(!c) if(!c)
for(c = globalconf.clients; c && (c->skip || !client_isvisible(c, screen)); c = c->next); for(c = globalconf.clients; c && (c->skip || !client_isvisible(c, screen)); c = c->next);
if(c) if(c)
{
focus(c, True, screen); focus(c, True, screen);
restack(screen);
}
} }
/** Send focus to previous client in stack /** Send focus to previous client in stack
@ -975,10 +971,7 @@ uicb_client_focusprev(int screen, char *arg __attribute__ ((unused)))
Client *prev; Client *prev;
if((prev = client_find_prev_visible(globalconf.focus->client))) if((prev = client_find_prev_visible(globalconf.focus->client)))
{
focus(prev, True, screen); focus(prev, True, screen);
restack(screen);
}
} }
/** Toggle floating state of a client /** Toggle floating state of a client

View File

@ -113,7 +113,6 @@ handle_event_buttonpress(XEvent *e)
if(CLEANMASK(ev->state) == NoSymbol if(CLEANMASK(ev->state) == NoSymbol
&& ev->button == Button1) && ev->button == Button1)
{ {
restack(c->screen);
XAllowEvents(globalconf.display, ReplayPointer, CurrentTime); XAllowEvents(globalconf.display, ReplayPointer, CurrentTime);
window_grabbuttons(get_phys_screen(c->screen), c->win, True, True); window_grabbuttons(get_phys_screen(c->screen), c->win, True, True);
} }

View File

@ -76,7 +76,6 @@ arrange(int screen)
window_grabbuttons(c->screen, c->win, False, False); window_grabbuttons(c->screen, c->win, False, False);
p_delete(&curtags); p_delete(&curtags);
restack(screen);
/* reset status */ /* reset status */
globalconf.screens[screen].need_arrange = False; globalconf.screens[screen].need_arrange = False;

View File

@ -61,8 +61,6 @@ uicb_client_movemouse(int screen, char *arg __attribute__ ((unused)))
client_setfloating(c, True); client_setfloating(c, True);
} }
restack(screen);
area = get_screen_area(c->screen, area = get_screen_area(c->screen,
globalconf.screens[screen].statusbar, globalconf.screens[screen].statusbar,
&globalconf.screens[screen].padding); &globalconf.screens[screen].padding);
@ -137,7 +135,6 @@ uicb_client_resizemouse(int screen, char *arg __attribute__ ((unused)))
{ {
if(layout->arrange == layout_floating || c->isfloating) if(layout->arrange == layout_floating || c->isfloating)
{ {
restack(screen);
ocx = c->geometry.x; ocx = c->geometry.x;
ocy = c->geometry.y; ocy = c->geometry.y;
c->ismax = False; c->ismax = False;