split untab function

This commit is contained in:
Julien Danjou 2007-10-15 17:15:10 +02:00
parent 0339b6f64b
commit cf2b6d9f4f
2 changed files with 28 additions and 19 deletions

45
tab.c
View File

@ -23,6 +23,30 @@
#include "event.h"
#include "layout.h"
void
client_untab(Client *c)
{
Client *tmp;
if(c->tab.next)
c->tab.next->tab.isvisible = True;
else if(c->tab.prev)
c->tab.prev->tab.isvisible = True;
c->tab.isvisible = True;
if(c->tab.next)
c->tab.next->tab.prev = c->tab.prev;
tmp = c->tab.next;
c->tab.next = NULL;
if(c->tab.prev)
c->tab.prev->tab.next = tmp;
c->tab.prev = NULL;
}
void
uicb_tab(awesome_config *awesomeconf,
const char *arg __attribute__ ((unused)))
@ -69,29 +93,12 @@ void
uicb_untab(awesome_config *awesomeconf,
const char *arg __attribute__ ((unused)))
{
Client *tmp, *sel = *awesomeconf->client_sel;
Client *sel = *awesomeconf->client_sel;
if(!sel)
return;
if(sel->tab.next)
sel->tab.next->tab.isvisible = True;
else if(sel->tab.prev)
sel->tab.prev->tab.isvisible = True;
sel->tab.isvisible = True;
if(sel->tab.next)
sel->tab.next->tab.prev = sel->tab.prev;
tmp = sel->tab.next;
sel->tab.next = NULL;
if(sel->tab.prev)
sel->tab.prev->tab.next = tmp;
sel->tab.prev = NULL;
client_untab(sel);
arrange(awesomeconf->display, awesomeconf);
focus(awesomeconf->display, sel, True, awesomeconf);
}

2
tab.h
View File

@ -24,6 +24,8 @@
#include "common.h"
void client_untab(Client *);
UICB_PROTO(uicb_tab);
UICB_PROTO(uicb_untab);
UICB_PROTO(uicb_viewnexttab);