Client: When a client is deleted, his previous client take the focus.

This commit is contained in:
Martin Duquesnoy 2009-03-28 15:12:47 +01:00
parent cf96cf9715
commit 0faf031150
2 changed files with 11 additions and 1 deletions

View File

@ -696,6 +696,8 @@ client_unhide(Client *c)
void
client_unmanage(Client *c)
{
Client *c_next = NULL;
XGrabServer(dpy);
XSetErrorHandler(errorhandlerdummy);
XReparentWindow(dpy, c->win, ROOT, c->geo.x, c->geo.y);
@ -712,6 +714,15 @@ client_unmanage(Client *c)
ewmh_get_client_list();
arrange(c->screen);
XFree(c->title);
/* To focus the previous client */
for(c_next = clients;
c_next && c_next != c->prev && c_next->tag != c->tag && c_next->screen != c->screen;
c_next = c_next->next);
if(c_next && c_next->tag == seltag[selscreen] && c_next->screen == selscreen)
client_focus(c_next);
free(c);
return;

View File

@ -245,7 +245,6 @@ uicb_menu(uicb_t cmd)
x = sgeo[selscreen].x + conf.menu[i].x;
y = sgeo[selscreen].y + conf.menu[i].y;
}
menu_draw(conf.menu[i], x, y);
}