Compare commits
No commits in common. "e9ec60d532c841fa64114b6afe53ad57593c28d4" and "88316278946f21b7708f533e0bc12c0db71c310b" have entirely different histories.
e9ec60d532
...
8831627894
2
README
2
README
|
@ -57,7 +57,7 @@ Customisations
|
||||||
* When moving window to a different tag, focus follows the destination tag.
|
* When moving window to a different tag, focus follows the destination tag.
|
||||||
* Merged patch: https://dwm.suckless.org/patches/bottomstack/dwm-bottomstack-6.1.diff
|
* Merged patch: https://dwm.suckless.org/patches/bottomstack/dwm-bottomstack-6.1.diff
|
||||||
* Merged patch: https://dwm.suckless.org/patches/hide_vacant_tags/dwm-hide_vacant_tags-6.2.diff
|
* Merged patch: https://dwm.suckless.org/patches/hide_vacant_tags/dwm-hide_vacant_tags-6.2.diff
|
||||||
|
* Merged patch: https://dwm.suckless.org/patches/warp/dwm-warp-git-20160626-7af4d43.diff
|
||||||
* Merged patch: https://dwm.suckless.org/patches/dwmc/dwm-dwmc-6.2.diff
|
* Merged patch: https://dwm.suckless.org/patches/dwmc/dwm-dwmc-6.2.diff
|
||||||
* Merged patch: https: //dwm.suckless.org/patches/cfacts/dwm-cfacts-6.2.diff
|
* Merged patch: https: //dwm.suckless.org/patches/cfacts/dwm-cfacts-6.2.diff
|
||||||
* Merged patch: https://dwm.suckless.org/patches/fibonacci/dwm-fibonacci-5.8.2.diff
|
* Merged patch: https://dwm.suckless.org/patches/fibonacci/dwm-fibonacci-5.8.2.diff
|
||||||
* Merged patch: https://dwm.suckless.org/patches/focusonclick/dwm-focusonclick-20171030-6aa8e37.diff
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ static const unsigned int borderpx = 1; /* border pixel of windows */
|
||||||
static const unsigned int snap = 32; /* snap pixel */
|
static const unsigned int snap = 32; /* snap pixel */
|
||||||
static const int showbar = 1; /* 0 means no bar */
|
static const int showbar = 1; /* 0 means no bar */
|
||||||
static const int topbar = 1; /* 0 means bottom bar */
|
static const int topbar = 1; /* 0 means bottom bar */
|
||||||
static const int focusonwheel = 0;
|
|
||||||
static const char *fonts[] = { "monospace:size=10" };
|
static const char *fonts[] = { "monospace:size=10" };
|
||||||
static const char dmenufont[] = "monospace:size=10";
|
static const char dmenufont[] = "monospace:size=10";
|
||||||
static const char col_gray1[] = "#222222";
|
static const char col_gray1[] = "#222222";
|
||||||
|
|
1
config.h
1
config.h
|
@ -5,7 +5,6 @@ static const unsigned int borderpx = 1; /* border pixel of windows */
|
||||||
static const unsigned int snap = 32; /* snap pixel */
|
static const unsigned int snap = 32; /* snap pixel */
|
||||||
static const int showbar = 0; /* 0 means no bar */
|
static const int showbar = 0; /* 0 means no bar */
|
||||||
static const int topbar = 1; /* 0 means bottom bar */
|
static const int topbar = 1; /* 0 means bottom bar */
|
||||||
static const int focusonwheel = 0;
|
|
||||||
static const char *fonts[] = { "xos4 Terminus:size=12" };
|
static const char *fonts[] = { "xos4 Terminus:size=12" };
|
||||||
static const char dmenufont[] = "xos4 Terminus:size=14";
|
static const char dmenufont[] = "xos4 Terminus:size=14";
|
||||||
static const char col_bg[] = "#000000";
|
static const char col_bg[] = "#000000";
|
||||||
|
|
58
dwm.c
58
dwm.c
|
@ -188,6 +188,7 @@ static void manage(Window w, XWindowAttributes *wa);
|
||||||
static void mappingnotify(XEvent *e);
|
static void mappingnotify(XEvent *e);
|
||||||
static void maprequest(XEvent *e);
|
static void maprequest(XEvent *e);
|
||||||
static void monocle(Monitor *m);
|
static void monocle(Monitor *m);
|
||||||
|
static void motionnotify(XEvent *e);
|
||||||
static void movemouse(const Arg *arg);
|
static void movemouse(const Arg *arg);
|
||||||
static Client *nexttiled(Client *c);
|
static Client *nexttiled(Client *c);
|
||||||
static void pop(Client *);
|
static void pop(Client *);
|
||||||
|
@ -234,6 +235,7 @@ static void updatetitle(Client *c);
|
||||||
static void updatewindowtype(Client *c);
|
static void updatewindowtype(Client *c);
|
||||||
static void updatewmhints(Client *c);
|
static void updatewmhints(Client *c);
|
||||||
static void view(const Arg *arg);
|
static void view(const Arg *arg);
|
||||||
|
static void warp(const Client *c);
|
||||||
static Client *wintoclient(Window w);
|
static Client *wintoclient(Window w);
|
||||||
static Monitor *wintomon(Window w);
|
static Monitor *wintomon(Window w);
|
||||||
static int xerror(Display *dpy, XErrorEvent *ee);
|
static int xerror(Display *dpy, XErrorEvent *ee);
|
||||||
|
@ -264,6 +266,7 @@ static void (*handler[LASTEvent]) (XEvent *) = {
|
||||||
[KeyPress] = keypress,
|
[KeyPress] = keypress,
|
||||||
[MappingNotify] = mappingnotify,
|
[MappingNotify] = mappingnotify,
|
||||||
[MapRequest] = maprequest,
|
[MapRequest] = maprequest,
|
||||||
|
[MotionNotify] = motionnotify,
|
||||||
[PropertyNotify] = propertynotify,
|
[PropertyNotify] = propertynotify,
|
||||||
[UnmapNotify] = unmapnotify
|
[UnmapNotify] = unmapnotify
|
||||||
};
|
};
|
||||||
|
@ -432,8 +435,7 @@ buttonpress(XEvent *e)
|
||||||
|
|
||||||
click = ClkRootWin;
|
click = ClkRootWin;
|
||||||
/* focus monitor if necessary */
|
/* focus monitor if necessary */
|
||||||
if ((m = wintomon(ev->window)) && m != selmon
|
if ((m = wintomon(ev->window)) && m != selmon) {
|
||||||
&& (focusonwheel || (ev->button != Button4 && ev->button != Button5))) {
|
|
||||||
unfocus(selmon->sel, 1);
|
unfocus(selmon->sel, 1);
|
||||||
selmon = m;
|
selmon = m;
|
||||||
focus(NULL);
|
focus(NULL);
|
||||||
|
@ -458,10 +460,10 @@ buttonpress(XEvent *e)
|
||||||
else
|
else
|
||||||
click = ClkWinTitle;
|
click = ClkWinTitle;
|
||||||
} else if ((c = wintoclient(ev->window))) {
|
} else if ((c = wintoclient(ev->window))) {
|
||||||
if (focusonwheel || (ev->button != Button4 && ev->button != Button5))
|
focus(c);
|
||||||
focus(c);
|
restack(selmon);
|
||||||
XAllowEvents(dpy, ReplayPointer, CurrentTime);
|
XAllowEvents(dpy, ReplayPointer, CurrentTime);
|
||||||
click = ClkClientWin;
|
click = ClkClientWin;
|
||||||
}
|
}
|
||||||
for (i = 0; i < LENGTH(buttons); i++)
|
for (i = 0; i < LENGTH(buttons); i++)
|
||||||
if (click == buttons[i].click && buttons[i].func && buttons[i].button == ev->button
|
if (click == buttons[i].click && buttons[i].func && buttons[i].button == ev->button
|
||||||
|
@ -841,6 +843,7 @@ focusmon(const Arg *arg)
|
||||||
unfocus(selmon->sel, 0);
|
unfocus(selmon->sel, 0);
|
||||||
selmon = m;
|
selmon = m;
|
||||||
focus(NULL);
|
focus(NULL);
|
||||||
|
warp(selmon->sel);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -955,7 +958,7 @@ grabbuttons(Client *c, int focused)
|
||||||
XGrabButton(dpy, buttons[i].button,
|
XGrabButton(dpy, buttons[i].button,
|
||||||
buttons[i].mask | modifiers[j],
|
buttons[i].mask | modifiers[j],
|
||||||
c->win, False, BUTTONMASK,
|
c->win, False, BUTTONMASK,
|
||||||
GrabModeSync, GrabModeSync, None, None);
|
GrabModeAsync, GrabModeSync, None, None);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1173,6 +1176,23 @@ monocle(Monitor *m)
|
||||||
resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0);
|
resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
motionnotify(XEvent *e)
|
||||||
|
{
|
||||||
|
static Monitor *mon = NULL;
|
||||||
|
Monitor *m;
|
||||||
|
XMotionEvent *ev = &e->xmotion;
|
||||||
|
|
||||||
|
if (ev->window != root)
|
||||||
|
return;
|
||||||
|
if ((m = recttomon(ev->x_root, ev->y_root, 1, 1)) != mon && mon) {
|
||||||
|
unfocus(selmon->sel, 1);
|
||||||
|
selmon = m;
|
||||||
|
focus(NULL);
|
||||||
|
}
|
||||||
|
mon = m;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
movemouse(const Arg *arg)
|
movemouse(const Arg *arg)
|
||||||
{
|
{
|
||||||
|
@ -1409,6 +1429,8 @@ restack(Monitor *m)
|
||||||
}
|
}
|
||||||
XSync(dpy, False);
|
XSync(dpy, False);
|
||||||
while (XCheckMaskEvent(dpy, EnterWindowMask, &ev));
|
while (XCheckMaskEvent(dpy, EnterWindowMask, &ev));
|
||||||
|
if (m == selmon && (m->tagset[m->seltags] & m->sel->tags) && selmon->lt[selmon->sellt] != &layouts[2])
|
||||||
|
warp(m->sel);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -2112,6 +2134,28 @@ view(const Arg *arg)
|
||||||
arrange(selmon);
|
arrange(selmon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
warp(const Client *c)
|
||||||
|
{
|
||||||
|
int x, y;
|
||||||
|
|
||||||
|
if (!c) {
|
||||||
|
XWarpPointer(dpy, None, root, 0, 0, 0, 0, selmon->wx + selmon->ww/2, selmon->wy + selmon->wh/2);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!getrootptr(&x, &y) ||
|
||||||
|
(x > c->x - c->bw &&
|
||||||
|
y > c->y - c->bw &&
|
||||||
|
x < c->x + c->w + c->bw*2 &&
|
||||||
|
y < c->y + c->h + c->bw*2) ||
|
||||||
|
(y > c->mon->by && y < c->mon->by + bh) ||
|
||||||
|
(c->mon->topbar && !y))
|
||||||
|
return;
|
||||||
|
|
||||||
|
XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w / 2, c->h / 2);
|
||||||
|
}
|
||||||
|
|
||||||
Client *
|
Client *
|
||||||
wintoclient(Window w)
|
wintoclient(Window w)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue