From 1004cefa2fc1618e84000b7d4ec04291a2e56f0f Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sat, 10 Nov 2007 10:45:32 +0100 Subject: [PATCH] Remove current tab support We will add a real new one later. --- Makefile | 2 +- awesomerc | 25 ---------- client.c | 12 +---- config.c | 7 --- config.h | 13 ----- layout.c | 6 +-- tab.c | 142 ------------------------------------------------------ tab.h | 35 -------------- tag.c | 4 +- 9 files changed, 5 insertions(+), 241 deletions(-) delete mode 100644 tab.c delete mode 100644 tab.h diff --git a/Makefile b/Makefile index 74c9aa4a..76b3cfed 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ include config.mk -SRC = client.c draw.c event.c layout.c awesome.c tag.c util.c config.c screen.c statusbar.c uicb.c tab.c window.c awesome-client-common.c +SRC = client.c draw.c event.c layout.c awesome.c tag.c util.c config.c screen.c statusbar.c uicb.c window.c awesome-client-common.c OBJ = ${SRC:.c=.o} ${LAYOUTS:.c=.o} SRCCLIENT = awesome-client.c awesome-client-common.c util.c diff --git a/awesomerc b/awesomerc index b041a62c..6f2b3ea2 100644 --- a/awesomerc +++ b/awesomerc @@ -18,7 +18,6 @@ colors focus_border = "#6666ff" focus_bg = "#6666ff" focus_fg = "#ffffff" - tab_border = "#ff0000" } screen 0 @@ -555,28 +554,4 @@ keys command = "toggletag" arg = "9" } - key - { - modkey = {"Mod4"} - key = "u" - command = "viewprevtab" - } - key - { - modkey = {"Mod4"} - key = "i" - command = "viewnexttab" - } - key - { - modkey = {"Mod4", "Control"} - key = "u" - command = "untab" - } - key - { - modkey = {"Mod4", "Control"} - key = "i" - command = "tab" - } } diff --git a/client.c b/client.c index e79f5072..c3c2fcc9 100644 --- a/client.c +++ b/client.c @@ -24,7 +24,6 @@ #include #include "screen.h" -#include "tab.h" #include "awesome.h" #include "layout.h" #include "tag.h" @@ -199,14 +198,10 @@ focus(Client *c, Bool selscreen, awesome_config *awesomeconf) } if(c) { - if(c->tab.next || c->tab.prev) - XSetWindowBorder(awesomeconf->display, c->win, awesomeconf->colors_tab[ColBorder].pixel); - else - XSetWindowBorder(awesomeconf->display, c->win, awesomeconf->colors_selected[ColBorder].pixel); - } - if(c) + XSetWindowBorder(awesomeconf->display, c->win, awesomeconf->colors_selected[ColBorder].pixel); window_grabbuttons(c->display, c->phys_screen, c->win, True, True, awesomeconf->modkey, awesomeconf->numlockmask); + } if(!selscreen) return; tag->client_sel = c; @@ -280,8 +275,6 @@ client_manage(Window w, XWindowAttributes *wa, awesome_config *awesomeconf) c->display = awesomeconf->display; c->phys_screen = awesomeconf->phys_screen; - c->tab.isvisible = True; - /* if window request fullscreen mode */ if(c->w == screen_info[awesomeconf->screen].width && c->h == screen_info[awesomeconf->screen].height) { @@ -493,7 +486,6 @@ client_unmanage(Client *c, long state, awesome_config *awesomeconf) XWindowChanges wc; int tag; - client_untab(c); wc.border_width = c->oldborder; /* The server grab construct avoids race conditions. */ XGrabServer(c->display); diff --git a/config.c b/config.c index c608cc69..2b067cb0 100644 --- a/config.c +++ b/config.c @@ -34,7 +34,6 @@ #include "tag.h" #include "statusbar.h" #include "layout.h" -#include "tab.h" #include "layouts/tile.h" #include "layouts/floating.h" #include "layouts/max.h" @@ -95,11 +94,6 @@ const NameFuncLink UicbList[] = { /* config.c */ {"reloadconfig", uicb_reloadconfig}, {"setstatustext", uicb_setstatustext}, - /* tab.c */ - {"tab", uicb_tab}, - {"untab", uicb_untab}, - {"viewnexttab", uicb_viewnexttab}, - {"viewprevtab", uicb_viewprevtab}, {NULL, NULL} }; @@ -313,7 +307,6 @@ parse_config(const char *confpatharg, awesome_config *awesomeconf) awesomeconf->colors_selected[ColBorder] = initxcolor(awesomeconf->display, awesomeconf->phys_screen, cfg_getstr(cfg_colors, "focus_border")); awesomeconf->colors_selected[ColBG] = initxcolor(awesomeconf->display, awesomeconf->phys_screen, cfg_getstr(cfg_colors, "focus_bg")); awesomeconf->colors_selected[ColFG] = initxcolor(awesomeconf->display, awesomeconf->phys_screen, cfg_getstr(cfg_colors, "focus_fg")); - awesomeconf->colors_tab[ColBorder] = initxcolor(awesomeconf->display, awesomeconf->phys_screen, cfg_getstr(cfg_colors, "tab_border")); /* Statusbar */ tmp = cfg_getstr(cfg_statusbar, "position"); diff --git a/config.h b/config.h index 9223c07c..fc097c17 100644 --- a/config.h +++ b/config.h @@ -109,17 +109,6 @@ struct Client Client *next; /** Previous client */ Client *prev; - /** Tabs support */ - struct - { - /** Next client in tab */ - Client *next; - /** Previous client in tab */ - Client *prev; - /** True if client is the visible one */ - Bool isvisible; - /** True if client is tabbed */ - } tab; /** Window of the client */ Window win; /** Client display */ @@ -204,8 +193,6 @@ struct awesome_config XColor colors_normal[ColLast]; /** Selected colors */ XColor colors_selected[ColLast]; - /** Tabbed colors */ - XColor colors_tab[ColLast]; /** Cursors */ Cursor cursor[CurLast]; /** Font */ diff --git a/layout.c b/layout.c index 5fed912d..779537c6 100644 --- a/layout.c +++ b/layout.c @@ -300,7 +300,7 @@ void uicb_zoom(awesome_config *awesomeconf, const char *arg __attribute__ ((unused))) { - Client *c, *sel = get_current_tag(awesomeconf->tags, awesomeconf->ntags)->client_sel; + Client *sel = get_current_tag(awesomeconf->tags, awesomeconf->ntags)->client_sel; if(!sel) return; @@ -308,10 +308,6 @@ uicb_zoom(awesome_config *awesomeconf, client_detach(awesomeconf->clients, sel); client_attach(awesomeconf->clients, sel); - /* reattach tabbed windows just after the master one */ - for(c = sel->tab.next; c; c = c->tab.next) - client_reattach_after(sel, c); - focus(sel, True, awesomeconf); arrange(awesomeconf); } diff --git a/tab.c b/tab.c deleted file mode 100644 index 60fe0240..00000000 --- a/tab.c +++ /dev/null @@ -1,142 +0,0 @@ -/* - * tab.c - tab management - * - * Copyright © 2007 Julien Danjou - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - */ - -#include "tab.h" -#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))) -{ - Window dummy, child; - int x1, y1, di; - unsigned int dui; - XEvent ev; - Client *sel = get_current_tag(awesomeconf->tags, awesomeconf->ntags)->client_sel, *c = NULL, *tmp; - - if(XGrabPointer(awesomeconf->display, RootWindow(awesomeconf->display, awesomeconf->phys_screen), - False, ButtonPressMask, GrabModeAsync, GrabModeAsync, None, - awesomeconf[awesomeconf->screen].cursor[CurMove], CurrentTime) != GrabSuccess) - return; - - for(;;) - { - XMaskEvent(awesomeconf->display, ButtonPressMask, &ev); - if(ev.type == ButtonPress) - { - XUngrabPointer(awesomeconf->display, CurrentTime); - break; - } - } - - XQueryPointer(awesomeconf->display, - RootWindow(awesomeconf->display, awesomeconf->phys_screen), - &dummy, &child, &x1, &y1, &di, &di, &dui); - - if((c = get_client_bywin(*awesomeconf->clients, child)) - && c != sel && !c->isfloating) - { - /* take the last tabbed window */ - for(tmp = sel; tmp->tab.next; tmp = tmp->tab.next); - - tmp->tab.next = c; - if(c->tab.prev) - c->tab.prev->tab.next = tmp; - - c->tab.prev = tmp; - - c->tab.isvisible = False; - client_reattach_after(sel, c); - arrange(awesomeconf); - focus(sel, True, awesomeconf); - } -} - -void -uicb_untab(awesome_config *awesomeconf, - const char *arg __attribute__ ((unused))) -{ - Client *sel = get_current_tag(awesomeconf->tags, awesomeconf->ntags)->client_sel; - - if(!sel) - return; - - client_untab(sel); - arrange(awesomeconf); - focus(sel, True, awesomeconf); -} - -void -uicb_viewnexttab(awesome_config *awesomeconf, - const char *arg __attribute__ ((unused))) -{ - Client *sel = get_current_tag(awesomeconf->tags, awesomeconf->ntags)->client_sel; - - if(!sel || !sel->tab.next) - return; - - sel->tab.isvisible = False; - sel->tab.next->tab.isvisible = True; - arrange(awesomeconf); - focus(sel->tab.next, True, awesomeconf); -} - -void -uicb_viewprevtab(awesome_config *awesomeconf, - const char *arg __attribute__ ((unused))) -{ - Client *sel = get_current_tag(awesomeconf->tags, awesomeconf->ntags)->client_sel; - - if(!sel || !sel->tab.prev) - return; - - sel->tab.isvisible = False; - sel->tab.prev->tab.isvisible = True; - arrange(awesomeconf); - focus(sel->tab.prev, True, awesomeconf); -} - -// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 diff --git a/tab.h b/tab.h deleted file mode 100644 index 5777674d..00000000 --- a/tab.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * tab.h - tab management header - * - * Copyright © 2007 Julien Danjou - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - */ - -#ifndef AWESOME_TAB_H -#define AWESOME_TAB_H - -#include "common.h" - -void client_untab(Client *); - -UICB_PROTO(uicb_tab); -UICB_PROTO(uicb_untab); -UICB_PROTO(uicb_viewnexttab); -UICB_PROTO(uicb_viewprevtab); - -#endif -// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 diff --git a/tag.c b/tag.c index 1bf9efa0..74917e6f 100644 --- a/tag.c +++ b/tag.c @@ -24,7 +24,6 @@ #include "layout.h" #include "tag.h" -#include "tab.h" #include "util.h" /** This function returns the index of @@ -130,7 +129,7 @@ isvisible(Client * c, int screen, Tag * tags, int ntags) { int i; - if(c->screen != screen || !c->tab.isvisible) + if(c->screen != screen) return False; for(i = 0; i < ntags; i++) @@ -182,7 +181,6 @@ uicb_togglefloating(awesome_config * awesomeconf, else client_resize(sel, sel->x, sel->y, sel->w, sel->h, awesomeconf, True, True); - client_untab(sel); saveprops(sel, awesomeconf->ntags); arrange(awesomeconf); }