move tabbed windows collapsed in **clients list, so focusing next/prev will be nicer

This commit is contained in:
Julien Danjou 2007-10-17 15:09:59 +02:00
parent e7da450d3c
commit 02c07a8e11
3 changed files with 23 additions and 0 deletions

View File

@ -271,6 +271,27 @@ configure(Client * c)
XSendEvent(c->display, c->win, False, StructureNotifyMask, (XEvent *) & ce); XSendEvent(c->display, c->win, False, StructureNotifyMask, (XEvent *) & ce);
} }
/** Attach client after another one
* \param client to attach to
* \param c the client
*/
void
client_reattach_after(Client *head, Client *c)
{
if(head->next == c)
return;
if(head->next)
head->next->prev = c;
if(c->prev)
c->prev->next = c->next;
c->next = head->next;
head->next = c;
c->prev = head;
}
/** Attach client to the beginning of the clients stack /** Attach client to the beginning of the clients stack
* \param head client list * \param head client list
* \param c the client * \param c the client

View File

@ -31,6 +31,7 @@ Client * get_client_bywin(Client **, Window);
void grabbuttons(Client *, Bool, Bool, KeySym, unsigned int); void grabbuttons(Client *, Bool, Bool, KeySym, unsigned int);
inline void client_attach(Client **, Client *); inline void client_attach(Client **, Client *);
inline void client_detach(Client **, Client *); inline void client_detach(Client **, Client *);
void client_reattach_after(Client *, Client *);
void ban(Client *); /* bans c */ void ban(Client *); /* bans c */
void configure(Client *); /* send synthetic configure event */ void configure(Client *); /* send synthetic configure event */
void focus(Client *, Bool, awesome_config *); void focus(Client *, Bool, awesome_config *);

1
tab.c
View File

@ -89,6 +89,7 @@ uicb_tab(awesome_config *awesomeconf,
c->tab.prev = tmp; c->tab.prev = tmp;
c->tab.isvisible = False; c->tab.isvisible = False;
client_reattach_after(sel, c);
arrange(awesomeconf); arrange(awesomeconf);
focus(sel, True, awesomeconf); focus(sel, True, awesomeconf);
} }