fix segfault in client_zoom

This commit is contained in:
Julien Danjou 2008-02-05 07:15:23 +01:00
parent 06904cfcaa
commit a26b40fa28
1 changed files with 10 additions and 7 deletions

View File

@ -1002,17 +1002,20 @@ uicb_client_zoom(int screen, char *arg __attribute__ ((unused)))
{ {
Client *c, *sel = globalconf.focus->client; Client *c, *sel = globalconf.focus->client;
if(!sel)
return;
for(c = globalconf.clients; !client_isvisible(c, screen); c = c->next); for(c = globalconf.clients; !client_isvisible(c, screen); c = c->next);
if(c == sel) if(c == sel)
for(sel = sel->next; sel && !client_isvisible(sel, screen); sel = sel->next); for(sel = sel->next; sel && !client_isvisible(sel, screen); sel = sel->next);
if(!sel) if(sel)
return; {
client_list_detach(&globalconf.clients, sel); client_list_detach(&globalconf.clients, sel);
client_list_push(&globalconf.clients, sel); client_list_push(&globalconf.clients, sel);
globalconf.screens[screen].need_arrange = True; globalconf.screens[screen].need_arrange = True;
globalconf.drop_events |= EnterWindowMask; globalconf.drop_events |= EnterWindowMask;
}
} }
/** Send focus to next client in stack /** Send focus to next client in stack