From f2da4d20d9a79070863972423ca964cf65342ba7 Mon Sep 17 00:00:00 2001 From: bakkeby Date: Wed, 15 Jul 2020 09:26:16 +0200 Subject: Further bar renaming --- patch/bar_ewmhtags.c | 40 ++++++++++++++++ patch/bar_ewmhtags.h | 7 +++ patch/bar_holdbar.c | 99 +++++++++++++++++++++++++++++++++++++++ patch/bar_holdbar.h | 3 ++ patch/bar_statuscolors.c | 27 +++++++++++ patch/ewmhtags.c | 40 ---------------- patch/ewmhtags.h | 7 --- patch/holdbar.c | 99 --------------------------------------- patch/holdbar.h | 3 -- patch/include.c | 27 +++++------ patch/include.h | 21 ++++----- patch/statuscmd.c | 18 -------- patch/statuscmd.h | 1 - patch/statuscolors.c | 27 ----------- patch/taggrid.c | 118 ----------------------------------------------- patch/taggrid.h | 2 - 16 files changed, 197 insertions(+), 342 deletions(-) create mode 100644 patch/bar_ewmhtags.c create mode 100644 patch/bar_ewmhtags.h create mode 100644 patch/bar_holdbar.c create mode 100644 patch/bar_holdbar.h create mode 100644 patch/bar_statuscolors.c delete mode 100644 patch/ewmhtags.c delete mode 100644 patch/ewmhtags.h delete mode 100644 patch/holdbar.c delete mode 100644 patch/holdbar.h delete mode 100644 patch/statuscmd.c delete mode 100644 patch/statuscmd.h delete mode 100644 patch/statuscolors.c delete mode 100644 patch/taggrid.c delete mode 100644 patch/taggrid.h diff --git a/patch/bar_ewmhtags.c b/patch/bar_ewmhtags.c new file mode 100644 index 0000000..682d900 --- /dev/null +++ b/patch/bar_ewmhtags.c @@ -0,0 +1,40 @@ +void +setcurrentdesktop(void) +{ + long data[] = { 0 }; + XChangeProperty(dpy, root, netatom[NetCurrentDesktop], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 1); +} + +void +setdesktopnames(void) +{ + XTextProperty text; + Xutf8TextListToTextProperty(dpy, tags, TAGSLENGTH, XUTF8StringStyle, &text); + XSetTextProperty(dpy, root, &text, netatom[NetDesktopNames]); +} + +void +setnumdesktops(void) +{ + long data[] = { TAGSLENGTH }; + XChangeProperty(dpy, root, netatom[NetNumberOfDesktops], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 1); +} + +void +setviewport(void) +{ + long data[] = { 0, 0 }; + XChangeProperty(dpy, root, netatom[NetDesktopViewport], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 2); +} + +void +updatecurrentdesktop(void) +{ + long rawdata[] = { selmon->tagset[selmon->seltags] }; + int i = 0; + while (*rawdata >> (i + 1)) { + i++; + } + long data[] = { i }; + XChangeProperty(dpy, root, netatom[NetCurrentDesktop], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 1); +} \ No newline at end of file diff --git a/patch/bar_ewmhtags.h b/patch/bar_ewmhtags.h new file mode 100644 index 0000000..2ec890e --- /dev/null +++ b/patch/bar_ewmhtags.h @@ -0,0 +1,7 @@ +#define TAGSLENGTH (LENGTH(tags)) + +static void setcurrentdesktop(void); +static void setdesktopnames(void); +static void setnumdesktops(void); +static void setviewport(void); +static void updatecurrentdesktop(void); \ No newline at end of file diff --git a/patch/bar_holdbar.c b/patch/bar_holdbar.c new file mode 100644 index 0000000..4be9af1 --- /dev/null +++ b/patch/bar_holdbar.c @@ -0,0 +1,99 @@ +void +holdbar(const Arg *arg) +{ + if (selmon->showbar) + return; + selmon->showbar = 2; + updateholdbarpos(selmon); + #if BAR_PADDING_PATCH + XMoveResizeWindow(dpy, selmon->barwin, selmon->wx + sp, selmon->by + vp, selmon->ww - 2 * sp, bh); + #else + XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh); + #endif // BAR_PADDING_PATCH + #if BAR_EXTRABAR_PATCH + #if BAR_PADDING_PATCH + XMoveResizeWindow(dpy, selmon->extrabarwin, selmon->wx + sp, selmon->eby - vp, selmon->ww - 2 * sp, bh); + #else + XMoveResizeWindow(dpy, selmon->extrabarwin, selmon->wx, selmon->eby, selmon->ww, bh); + #endif // BAR_PADDING_PATCH + #endif // BAR_EXTRABAR_PATCH +} + +void +keyrelease(XEvent *e) +{ + if (XEventsQueued(dpy, QueuedAfterReading)) { + XEvent ne; + XPeekEvent(dpy, &ne); + + if (ne.type == KeyPress && ne.xkey.time == e->xkey.time && + ne.xkey.keycode == e->xkey.keycode) { + XNextEvent(dpy, &ne); + return; + } + } + if (e->xkey.keycode == XKeysymToKeycode(dpy, HOLDKEY) && selmon->showbar == 2) { + selmon->showbar = 0; + updateholdbarpos(selmon); + #if BAR_PADDING_PATCH + XMoveResizeWindow(dpy, selmon->barwin, selmon->wx + sp, selmon->by + vp, selmon->ww - 2 * sp, bh); + #else + XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh); + #endif // BAR_PADDING_PATCH + #if BAR_EXTRABAR_PATCH + #if BAR_PADDING_PATCH + XMoveResizeWindow(dpy, selmon->extrabarwin, selmon->wx + sp, selmon->eby - vp, selmon->ww - 2 * sp, bh); + #else + XMoveResizeWindow(dpy, selmon->extrabarwin, selmon->wx, selmon->eby, selmon->ww, bh); + #endif // BAR_PADDING_PATCH + #endif // BAR_EXTRABAR_PATCH + arrange(selmon); + } + #if COMBO_PATCH + combo = 0; + #endif // COMBO_PATCH +} + +void +updateholdbarpos(Monitor *m) +{ + m->wy = m->my; + m->wh = m->mh; + #if BAR_EXTRABAR_PATCH + #if BAR_PADDING_PATCH + m->wh = m->wh - vertpad * m->showbar * 2 - bh * m->showbar * 2; + m->wy = m->showbar ? m->wy + bh + vertpad: m->wy; + if (m->showbar) { + m->by = m->topbar ? m->wy - bh - vertpad: m->wy + m->wh + vertpad; + m->eby = m->topbar ? m->wy + m->wh + vertpad: m->wy - bh - vertpad; + } else { + m->by = -bh - vertpad; + m->eby = -bh - vertpad; + } + #else + m->wh = m->wh - bh * m->showbar * 2; + m->wy = m->showbar ? m->wy + bh : m->wy; + if (m->showbar) { + m->by = m->topbar ? m->wy - bh : m->wy + m->wh; + m->eby = m->topbar ? m->wy + m->wh : m->wy - bh; + } else { + m->by = -bh; + m->eby = -bh; + } + #endif // BAR_PADDING_PATCH + #elif BAR_PADDING_PATCH + if (m->showbar) { + m->wh = m->wh - vertpad - bh; + m->by = m->topbar ? m->wy : m->wy + m->wh + vertpad; + m->wy = m->topbar ? m->wy + bh + vp : m->wy; + } else + m->by = -bh - vp; + #else + if (m->showbar) { + m->wh -= bh; + m->by = m->topbar ? m->wy : m->wy + m->wh; + m->wy = m->topbar ? m->wy + bh : m->wy; + } else + m->by = -bh; + #endif // BAR_EXTRABAR_PATCH +} diff --git a/patch/bar_holdbar.h b/patch/bar_holdbar.h new file mode 100644 index 0000000..719b9ea --- /dev/null +++ b/patch/bar_holdbar.h @@ -0,0 +1,3 @@ +static void keyrelease(XEvent *e); +static void holdbar(const Arg *arg); +static void updateholdbarpos(Monitor *m); \ No newline at end of file diff --git a/patch/bar_statuscolors.c b/patch/bar_statuscolors.c new file mode 100644 index 0000000..cc24ad4 --- /dev/null +++ b/patch/bar_statuscolors.c @@ -0,0 +1,27 @@ +int +textw_wosc(char *s) +{ + char *ts = s; + char *tp = s; + int sw = 0; + char ctmp; + while (1) { + if ((unsigned int)*ts > LENGTH(colors)) { + ts++; + continue; + } + ctmp = *ts; + *ts = '\0'; + #if BAR_PANGO_PATCH + sw += drw_font_getwidth(drw, tp, True); + #else + sw += drw_fontset_getwidth(drw, tp); + #endif // BAR_PANGO_PATCH + *ts = ctmp; + if (ctmp == '\0') + break; + tp = ++ts; + } + + return sw; +} \ No newline at end of file diff --git a/patch/ewmhtags.c b/patch/ewmhtags.c deleted file mode 100644 index 682d900..0000000 --- a/patch/ewmhtags.c +++ /dev/null @@ -1,40 +0,0 @@ -void -setcurrentdesktop(void) -{ - long data[] = { 0 }; - XChangeProperty(dpy, root, netatom[NetCurrentDesktop], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 1); -} - -void -setdesktopnames(void) -{ - XTextProperty text; - Xutf8TextListToTextProperty(dpy, tags, TAGSLENGTH, XUTF8StringStyle, &text); - XSetTextProperty(dpy, root, &text, netatom[NetDesktopNames]); -} - -void -setnumdesktops(void) -{ - long data[] = { TAGSLENGTH }; - XChangeProperty(dpy, root, netatom[NetNumberOfDesktops], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 1); -} - -void -setviewport(void) -{ - long data[] = { 0, 0 }; - XChangeProperty(dpy, root, netatom[NetDesktopViewport], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 2); -} - -void -updatecurrentdesktop(void) -{ - long rawdata[] = { selmon->tagset[selmon->seltags] }; - int i = 0; - while (*rawdata >> (i + 1)) { - i++; - } - long data[] = { i }; - XChangeProperty(dpy, root, netatom[NetCurrentDesktop], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 1); -} \ No newline at end of file diff --git a/patch/ewmhtags.h b/patch/ewmhtags.h deleted file mode 100644 index 2ec890e..0000000 --- a/patch/ewmhtags.h +++ /dev/null @@ -1,7 +0,0 @@ -#define TAGSLENGTH (LENGTH(tags)) - -static void setcurrentdesktop(void); -static void setdesktopnames(void); -static void setnumdesktops(void); -static void setviewport(void); -static void updatecurrentdesktop(void); \ No newline at end of file diff --git a/patch/holdbar.c b/patch/holdbar.c deleted file mode 100644 index 4be9af1..0000000 --- a/patch/holdbar.c +++ /dev/null @@ -1,99 +0,0 @@ -void -holdbar(const Arg *arg) -{ - if (selmon->showbar) - return; - selmon->showbar = 2; - updateholdbarpos(selmon); - #if BAR_PADDING_PATCH - XMoveResizeWindow(dpy, selmon->barwin, selmon->wx + sp, selmon->by + vp, selmon->ww - 2 * sp, bh); - #else - XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh); - #endif // BAR_PADDING_PATCH - #if BAR_EXTRABAR_PATCH - #if BAR_PADDING_PATCH - XMoveResizeWindow(dpy, selmon->extrabarwin, selmon->wx + sp, selmon->eby - vp, selmon->ww - 2 * sp, bh); - #else - XMoveResizeWindow(dpy, selmon->extrabarwin, selmon->wx, selmon->eby, selmon->ww, bh); - #endif // BAR_PADDING_PATCH - #endif // BAR_EXTRABAR_PATCH -} - -void -keyrelease(XEvent *e) -{ - if (XEventsQueued(dpy, QueuedAfterReading)) { - XEvent ne; - XPeekEvent(dpy, &ne); - - if (ne.type == KeyPress && ne.xkey.time == e->xkey.time && - ne.xkey.keycode == e->xkey.keycode) { - XNextEvent(dpy, &ne); - return; - } - } - if (e->xkey.keycode == XKeysymToKeycode(dpy, HOLDKEY) && selmon->showbar == 2) { - selmon->showbar = 0; - updateholdbarpos(selmon); - #if BAR_PADDING_PATCH - XMoveResizeWindow(dpy, selmon->barwin, selmon->wx + sp, selmon->by + vp, selmon->ww - 2 * sp, bh); - #else - XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh); - #endif // BAR_PADDING_PATCH - #if BAR_EXTRABAR_PATCH - #if BAR_PADDING_PATCH - XMoveResizeWindow(dpy, selmon->extrabarwin, selmon->wx + sp, selmon->eby - vp, selmon->ww - 2 * sp, bh); - #else - XMoveResizeWindow(dpy, selmon->extrabarwin, selmon->wx, selmon->eby, selmon->ww, bh); - #endif // BAR_PADDING_PATCH - #endif // BAR_EXTRABAR_PATCH - arrange(selmon); - } - #if COMBO_PATCH - combo = 0; - #endif // COMBO_PATCH -} - -void -updateholdbarpos(Monitor *m) -{ - m->wy = m->my; - m->wh = m->mh; - #if BAR_EXTRABAR_PATCH - #if BAR_PADDING_PATCH - m->wh = m->wh - vertpad * m->showbar * 2 - bh * m->showbar * 2; - m->wy = m->showbar ? m->wy + bh + vertpad: m->wy; - if (m->showbar) { - m->by = m->topbar ? m->wy - bh - vertpad: m->wy + m->wh + vertpad; - m->eby = m->topbar ? m->wy + m->wh + vertpad: m->wy - bh - vertpad; - } else { - m->by = -bh - vertpad; - m->eby = -bh - vertpad; - } - #else - m->wh = m->wh - bh * m->showbar * 2; - m->wy = m->showbar ? m->wy + bh : m->wy; - if (m->showbar) { - m->by = m->topbar ? m->wy - bh : m->wy + m->wh; - m->eby = m->topbar ? m->wy + m->wh : m->wy - bh; - } else { - m->by = -bh; - m->eby = -bh; - } - #endif // BAR_PADDING_PATCH - #elif BAR_PADDING_PATCH - if (m->showbar) { - m->wh = m->wh - vertpad - bh; - m->by = m->topbar ? m->wy : m->wy + m->wh + vertpad; - m->wy = m->topbar ? m->wy + bh + vp : m->wy; - } else - m->by = -bh - vp; - #else - if (m->showbar) { - m->wh -= bh; - m->by = m->topbar ? m->wy : m->wy + m->wh; - m->wy = m->topbar ? m->wy + bh : m->wy; - } else - m->by = -bh; - #endif // BAR_EXTRABAR_PATCH -} diff --git a/patch/holdbar.h b/patch/holdbar.h deleted file mode 100644 index 719b9ea..0000000 --- a/patch/holdbar.h +++ /dev/null @@ -1,3 +0,0 @@ -static void keyrelease(XEvent *e); -static void holdbar(const Arg *arg); -static void updateholdbarpos(Monitor *m); \ No newline at end of file diff --git a/patch/include.c b/patch/include.c index 5cde652..e35033e 100644 --- a/patch/include.c +++ b/patch/include.c @@ -8,6 +8,12 @@ #if BAR_DWMBLOCKS_PATCH && BAR_STATUSCMD_PATCH #include "bar_dwmblocks.c" #endif +#if BAR_EWMHTAGS_PATCH +#include "bar_ewmhtags.c" +#endif +#if BAR_HOLDBAR_PATCH +#include "bar_holdbar.c" +#endif #if BAR_LTSYMBOL_PATCH #include "bar_ltsymbol.c" #endif @@ -26,6 +32,9 @@ #if BAR_STATUSCMD_PATCH #include "bar_statuscmd.c" #endif +#if BAR_STATUSCOLORS_PATCH +#include "bar_statuscolors.c" +#endif #if BAR_TAGS_PATCH #include "bar_tags.c" #endif @@ -44,6 +53,9 @@ #if BAR_SYSTRAY_PATCH #include "bar_systray.c" #endif +#if BAR_VTCOLORS_PATCH +#include "bar_vtcolors.c" +#endif /* Other patches */ #if ATTACHABOVE_PATCH || ATTACHASIDE_PATCH || ATTACHBELOW_PATCH || ATTACHBOTTOM_PATCH @@ -72,9 +84,6 @@ #elif FSIGNAL_PATCH #include "fsignal.c" #endif -#if BAR_EWMHTAGS_PATCH -#include "ewmhtags.c" -#endif #if EXRESIZE_PATCH #include "exresize.c" #endif @@ -93,9 +102,6 @@ #if FULLSCREEN_PATCH #include "fullscreen.c" #endif -#if BAR_HOLDBAR_PATCH -#include "holdbar.c" -#endif #if INPLACEROTATE_PATCH #include "inplacerotate.c" #endif @@ -166,9 +172,6 @@ #if STACKER_PATCH #include "stacker.c" #endif -#if BAR_STATUSCOLORS_PATCH -#include "statuscolors.c" -#endif #if STICKY_PATCH #include "sticky.c" #endif @@ -190,9 +193,6 @@ #if TAGALLMON_PATCH #include "tagallmon.c" #endif -#if TAGGRID_PATCH -#include "taggrid.c" -#endif #if TAGOTHERMONITOR_PATCH #include "tagothermonitor.c" #endif @@ -214,9 +214,6 @@ #if VANITYGAPS_PATCH #include "vanitygaps.c" #endif -#if BAR_VTCOLORS_PATCH -#include "vtcolors.c" -#endif #if WARP_PATCH #include "warp.c" #endif diff --git a/patch/include.h b/patch/include.h index 49ce915..9065c87 100644 --- a/patch/include.h +++ b/patch/include.h @@ -8,6 +8,12 @@ #if BAR_DWMBLOCKS_PATCH && BAR_STATUSCMD_PATCH #include "bar_dwmblocks.h" #endif +#if BAR_EWMHTAGS_PATCH +#include "bar_ewmhtags.h" +#endif +#if BAR_HOLDBAR_PATCH +#include "bar_holdbar.h" +#endif #if BAR_LTSYMBOL_PATCH #include "bar_ltsymbol.h" #endif @@ -44,6 +50,9 @@ #if BAR_SYSTRAY_PATCH #include "bar_systray.h" #endif +#if BAR_VTCOLORS_PATCH +#include "bar_vtcolors.h" +#endif /* Other patches */ #if ATTACHABOVE_PATCH || ATTACHASIDE_PATCH || ATTACHBELOW_PATCH || ATTACHBOTTOM_PATCH @@ -75,9 +84,6 @@ #elif FSIGNAL_PATCH #include "fsignal.h" #endif -#if BAR_EWMHTAGS_PATCH -#include "ewmhtags.h" -#endif #if EXRESIZE_PATCH #include "exresize.h" #endif @@ -96,9 +102,6 @@ #if FULLSCREEN_PATCH #include "fullscreen.h" #endif -#if BAR_HOLDBAR_PATCH -#include "holdbar.h" -#endif #if INPLACEROTATE_PATCH #include "inplacerotate.h" #endif @@ -190,9 +193,6 @@ #if TAGALLMON_PATCH #include "tagallmon.h" #endif -#if TAGGRID_PATCH -#include "taggrid.h" -#endif #if TAGOTHERMONITOR_PATCH #include "tagothermonitor.h" #endif @@ -214,9 +214,6 @@ #if VANITYGAPS_PATCH #include "vanitygaps.h" #endif -#if BAR_VTCOLORS_PATCH -#include "vtcolors.h" -#endif #if WARP_PATCH #include "warp.h" #endif diff --git a/patch/statuscmd.c b/patch/statuscmd.c deleted file mode 100644 index b38739d..0000000 --- a/patch/statuscmd.c +++ /dev/null @@ -1,18 +0,0 @@ -#if !DWMBLOCKS_PATCH -static const char statusexport[] = "export BUTTON=-;"; -static int statuscmdn; -static int lastbutton; -#endif // DWMBLOCKS_PATCH - -void -copyvalidchars(char *text, char *rawtext) -{ - int i = -1, j = 0; - - while (rawtext[++i]) { - if ((unsigned char)rawtext[i] >= ' ') { - text[j++] = rawtext[i]; - } - } - text[j] = '\0'; -} diff --git a/patch/statuscmd.h b/patch/statuscmd.h deleted file mode 100644 index 77391b6..0000000 --- a/patch/statuscmd.h +++ /dev/null @@ -1 +0,0 @@ -static void copyvalidchars(char *text, char *rawtext); \ No newline at end of file diff --git a/patch/statuscolors.c b/patch/statuscolors.c deleted file mode 100644 index cc24ad4..0000000 --- a/patch/statuscolors.c +++ /dev/null @@ -1,27 +0,0 @@ -int -textw_wosc(char *s) -{ - char *ts = s; - char *tp = s; - int sw = 0; - char ctmp; - while (1) { - if ((unsigned int)*ts > LENGTH(colors)) { - ts++; - continue; - } - ctmp = *ts; - *ts = '\0'; - #if BAR_PANGO_PATCH - sw += drw_font_getwidth(drw, tp, True); - #else - sw += drw_fontset_getwidth(drw, tp); - #endif // BAR_PANGO_PATCH - *ts = ctmp; - if (ctmp == '\0') - break; - tp = ++ts; - } - - return sw; -} \ No newline at end of file diff --git a/patch/taggrid.c b/patch/taggrid.c deleted file mode 100644 index bfa19ec..0000000 --- a/patch/taggrid.c +++ /dev/null @@ -1,118 +0,0 @@ -void drawtaggrid(Monitor *m, int *x_pos, unsigned int occ) -{ - unsigned int x, y, h, max_x, columns; - int invert, i,j, k; - - h = bh / tagrows; - x = max_x = *x_pos; - y = 0; - columns = LENGTH(tags) / tagrows + ((LENGTH(tags) % tagrows > 0) ? 1 : 0); - - /* Firstly we will fill the borders of squares */ - - XSetForeground(drw->dpy, drw->gc, scheme[SchemeNorm][ColBorder].pixel); - XFillRectangle(dpy, drw->drawable, drw->gc, x, y, h*columns + 1, bh); - - /* We will draw LENGTH(tags) squares in tagraws raws. */ - for (j = 0, i= 0; j < tagrows; j++) { - x = *x_pos; - for (k = 0; k < columns && i < LENGTH(tags); k++, i++) { - invert = m->tagset[m->seltags] & 1 << i ? 0 : 1; - - /* Select active color for current square */ - XSetForeground(drw->dpy, drw->gc, !invert ? scheme[SchemeSel][ColBg].pixel : - scheme[SchemeNorm][ColFg].pixel); - XFillRectangle(dpy, drw->drawable, drw->gc, x+1, y+1, h-1, h-1); - - /* Mark square if tag has client */ - if (occ & 1 << i) { - XSetForeground(drw->dpy, drw->gc, !invert ? scheme[SchemeSel][ColFg].pixel : - scheme[SchemeNorm][ColBg].pixel); - XFillRectangle(dpy, drw->drawable, drw->gc, x + 1, y + 1, - h / 2, h / 2); - } - x += h; - if (x > max_x) { - max_x = x; - } - } - y += h; - } - *x_pos = max_x + 1; -} - -void switchtag(const Arg *arg) -{ - unsigned int columns; - unsigned int new_tagset = 0; - unsigned int pos, i; - int col, row; - Arg new_arg; - - columns = LENGTH(tags) / tagrows + ((LENGTH(tags) % tagrows > 0) ? 1 : 0); - - for (i = 0; i < LENGTH(tags); ++i) { - if (!(selmon->tagset[selmon->seltags] & 1 << i)) { - continue; - } - pos = i; - row = pos / columns; - col = pos % columns; - if (arg->ui & SWITCHTAG_UP) { /* UP */ - row --; - if (row < 0) { - row = tagrows - 1; - } - do { - pos = row * columns + col; - row --; - } while (pos >= LENGTH(tags)); - } - if (arg->ui & SWITCHTAG_DOWN) { /* DOWN */ - row ++; - if (row >= tagrows) { - row = 0; - } - pos = row * columns + col; - if (pos >= LENGTH(tags)) { - row = 0; - } - pos = row * columns + col; - } - if (arg->ui & SWITCHTAG_LEFT) { /* LEFT */ - col --; - if (col < 0) { - col = columns - 1; - } - do { - pos = row * columns + col; - col --; - } while (pos >= LENGTH(tags)); - } - if (arg->ui & SWITCHTAG_RIGHT) { /* RIGHT */ - col ++; - if (col >= columns) { - col = 0; - } - pos = row * columns + col; - if (pos >= LENGTH(tags)) { - col = 0; - pos = row * columns + col; - } - } - new_tagset |= 1 << pos; - } - new_arg.ui = new_tagset; - if (arg->ui & SWITCHTAG_TOGGLETAG) { - toggletag(&new_arg); - } - if (arg->ui & SWITCHTAG_TAG) { - tag(&new_arg); - } - if (arg->ui & SWITCHTAG_VIEW) { - view (&new_arg); - } - if (arg->ui & SWITCHTAG_TOGGLEVIEW) { - toggleview (&new_arg); - } -} \ No newline at end of file diff --git a/patch/taggrid.h b/patch/taggrid.h deleted file mode 100644 index 27343a6..0000000 --- a/patch/taggrid.h +++ /dev/null @@ -1,2 +0,0 @@ -static void drawtaggrid(Monitor *m, int *x_pos, unsigned int occ); -static void switchtag(const Arg *arg); \ No newline at end of file -- cgit v1.2.3