diff --git a/tab.c b/tab.c index 6a6146b2..b7cc45b3 100644 --- a/tab.c +++ b/tab.c @@ -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); } diff --git a/tab.h b/tab.h index dc0af900..5777674d 100644 --- a/tab.h +++ b/tab.h @@ -24,6 +24,8 @@ #include "common.h" +void client_untab(Client *); + UICB_PROTO(uicb_tab); UICB_PROTO(uicb_untab); UICB_PROTO(uicb_viewnexttab);