mirror of
https://github.com/eRgo35/dots.git
synced 2025-12-18 08:26:11 +01:00
final patches
This commit is contained in:
@@ -1,93 +1,20 @@
|
||||
--- dwm.c
|
||||
+++ dwm.c
|
||||
@@ -118,6 +119,8 @@ struct Monitor {
|
||||
int nmaster;
|
||||
int num;
|
||||
int by; /* bar geometry */
|
||||
+ int btw; /* width of tasks portion of bar */
|
||||
+ int bt; /* number of tasks */
|
||||
int mx, my, mw, mh; /* screen size */
|
||||
int wx, wy, ww, wh; /* window area */
|
||||
unsigned int seltags;
|
||||
@@ -125,6 +128,7 @@ struct Monitor {
|
||||
unsigned int tagset[2];
|
||||
int showbar;
|
||||
int topbar;
|
||||
+ int hidsel;
|
||||
Client *clients;
|
||||
Client *sel;
|
||||
Client *stack;
|
||||
@@ -169,13 +173,17 @@ static void expose(XEvent *e);
|
||||
static void focus(Client *c);
|
||||
static void focusin(XEvent *e);
|
||||
static void focusmon(const Arg *arg);
|
||||
-static void focusstack(const Arg *arg);
|
||||
+static void focusstackvis(const Arg *arg);
|
||||
+static void focusstackhid(const Arg *arg);
|
||||
+static void focusstack(int inc, int vis);
|
||||
static Atom getatomprop(Client *c, Atom prop);
|
||||
static int getrootptr(int *x, int *y);
|
||||
static long getstate(Window w);
|
||||
static int gettextprop(Window w, Atom atom, char *text, unsigned int size);
|
||||
static void grabbuttons(Client *c, int focused);
|
||||
static void grabkeys(void);
|
||||
+static void hide(const Arg *arg);
|
||||
+static void hidewin(Client *c);
|
||||
static void incnmaster(const Arg *arg);
|
||||
static void keypress(XEvent *e);
|
||||
static void killclient(const Arg *arg);
|
||||
@@ -445,10 +457,25 @@ buttonpress(XEvent *e)
|
||||
arg.ui = 1 << i;
|
||||
} else if (ev->x < x + blw)
|
||||
click = ClkLtSymbol;
|
||||
- else if (ev->x > selmon->ww - (int)TEXTW(stext))
|
||||
+ /* 2px right padding */
|
||||
+ else if (ev->x > selmon->ww - TEXTW(stext) + lrpad - 2)
|
||||
click = ClkStatusText;
|
||||
- else
|
||||
- click = ClkWinTitle;
|
||||
+ else {
|
||||
+ x += blw;
|
||||
+ c = m->clients;
|
||||
+
|
||||
+ if (c) {
|
||||
+ do {
|
||||
+ if (!ISVISIBLE(c))
|
||||
+ continue;
|
||||
+ else
|
||||
+ x +=(1.0 / (double)m->bt) * m->btw;
|
||||
+ } while (ev->x > x && (c = c->next));
|
||||
+
|
||||
+ click = ClkWinTitle;
|
||||
+ arg.v = c;
|
||||
+ }
|
||||
+ }
|
||||
} else if ((c = wintoclient(ev->window))) {
|
||||
focus(c);
|
||||
restack(selmon);
|
||||
@@ -458,7 +485,7 @@ buttonpress(XEvent *e)
|
||||
for (i = 0; i < LENGTH(buttons); i++)
|
||||
if (click == buttons[i].click && buttons[i].func && buttons[i].button == ev->button
|
||||
&& CLEANMASK(buttons[i].mask) == CLEANMASK(ev->state))
|
||||
- buttons[i].func(click == ClkTagBar && buttons[i].arg.i == 0 ? &arg : &buttons[i].arg);
|
||||
+ buttons[i].func((click == ClkTagBar || click == ClkWinTitle) && buttons[i].arg.i == 0 ? &arg : &buttons[i].arg);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1343,6 +1456,16 @@ propertynotify(XEvent *e)
|
||||
void
|
||||
quit(const Arg *arg)
|
||||
{
|
||||
+ // fix: reloading dwm keeps all the hidden clients hidden
|
||||
+ Monitor *m;
|
||||
+ Client *c;
|
||||
+ for (m = mons; m; m = m->next) {
|
||||
+ if (m) {
|
||||
+ for (c = m->stack; c; c = c->next)
|
||||
+ if (c && HIDDEN(c)) showwin(c);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
running = 0;
|
||||
}
|
||||
|
||||
--- dwm.c 2020-07-05 16:05:02.555947738 -0300
|
||||
+++ dwm.c 2020-07-05 16:06:19.592609932 -0300
|
||||
@@ -49,7 +49,8 @@
|
||||
#define CLEANMASK(mask) (mask & ~(numlockmask|LockMask) & (ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask))
|
||||
#define INTERSECT(x,y,w,h,m) (MAX(0, MIN((x)+(w),(m)->wx+(m)->ww) - MAX((x),(m)->wx)) \
|
||||
* MAX(0, MIN((y)+(h),(m)->wy+(m)->wh) - MAX((y),(m)->wy)))
|
||||
-#define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags]))
|
||||
+#define ISVISIBLEONTAG(C, T) ((C->tags & T))
|
||||
+#define ISVISIBLE(C) ISVISIBLEONTAG(C, C->mon->tagset[C->mon->seltags])
|
||||
#define LENGTH(X) (sizeof X / sizeof X[0])
|
||||
#define MOUSEMASK (BUTTONMASK|PointerMotionMask)
|
||||
#define WIDTH(X) ((X)->w + 2 * (X)->bw)
|
||||
@@ -1934,6 +1968,7 @@ updategeom(void)
|
||||
detachstack(c);
|
||||
c->mon = mons;
|
||||
attach(c);
|
||||
+ attachBelow(c);
|
||||
attachstack(c);
|
||||
}
|
||||
if (m == selmon)
|
||||
|
||||
Reference in New Issue
Block a user