Combo Tag & View Patches
- Add combo tag & view patch - Change tag and view functions to combotag and comboview in config.h
This commit is contained in:
43
dwm.c
43
dwm.c
@@ -270,6 +270,11 @@ static int xerrordummy(Display *dpy, XErrorEvent *ee);
|
||||
static int xerrorstart(Display *dpy, XErrorEvent *ee);
|
||||
static void zoom(const Arg *arg);
|
||||
|
||||
static void keyrelease(XEvent *e);
|
||||
static void combotag(const Arg *arg);
|
||||
static void comboview(const Arg *arg);
|
||||
|
||||
|
||||
/* variables */
|
||||
static const char autostartblocksh[] = "autostart_blocking.sh";
|
||||
static const char autostartsh[] = "autostart.sh";
|
||||
@@ -285,6 +290,7 @@ static int (*xerrorxlib)(Display *, XErrorEvent *);
|
||||
static unsigned int numlockmask = 0;
|
||||
static void (*handler[LASTEvent]) (XEvent *) = {
|
||||
[ButtonPress] = buttonpress,
|
||||
[ButtonRelease] = keyrelease,
|
||||
[ClientMessage] = clientmessage,
|
||||
[ConfigureRequest] = configurerequest,
|
||||
[ConfigureNotify] = configurenotify,
|
||||
@@ -292,6 +298,7 @@ static void (*handler[LASTEvent]) (XEvent *) = {
|
||||
[EnterNotify] = enternotify,
|
||||
[Expose] = expose,
|
||||
[FocusIn] = focusin,
|
||||
[KeyRelease] = keyrelease,
|
||||
[KeyPress] = keypress,
|
||||
[MappingNotify] = mappingnotify,
|
||||
[MapRequest] = maprequest,
|
||||
@@ -316,6 +323,42 @@ static Window root, wmcheckwin;
|
||||
struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
|
||||
|
||||
/* function implementations */
|
||||
static int combo = 0;
|
||||
|
||||
void
|
||||
keyrelease(XEvent *e) {
|
||||
combo = 0;
|
||||
}
|
||||
|
||||
void
|
||||
combotag(const Arg *arg) {
|
||||
if(selmon->sel && arg->ui & TAGMASK) {
|
||||
if (combo) {
|
||||
selmon->sel->tags |= arg->ui & TAGMASK;
|
||||
} else {
|
||||
combo = 1;
|
||||
selmon->sel->tags = arg->ui & TAGMASK;
|
||||
}
|
||||
focus(NULL);
|
||||
arrange(selmon);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
comboview(const Arg *arg) {
|
||||
unsigned newtags = arg->ui & TAGMASK;
|
||||
if (combo) {
|
||||
selmon->tagset[selmon->seltags] |= newtags;
|
||||
} else {
|
||||
selmon->seltags ^= 1; /*toggle tagset*/
|
||||
combo = 1;
|
||||
if (newtags)
|
||||
selmon->tagset[selmon->seltags] = newtags;
|
||||
}
|
||||
focus(NULL);
|
||||
arrange(selmon);
|
||||
}
|
||||
|
||||
void
|
||||
applyrules(Client *c)
|
||||
{
|
||||
|
Reference in New Issue
Block a user