old config restore

This commit is contained in:
2023-09-20 21:19:07 +02:00
parent faedc5a5ea
commit 4df8f384b8
28 changed files with 334 additions and 299 deletions

60
dwm.c
View File

@@ -484,7 +484,7 @@ struct Monitor {
int gappov; /* vertical outer gaps */
#endif // VANITYGAPS_PATCH
#if SETBORDERPX_PATCH
int borderpx;
unsigned int borderpx;
#endif // SETBORDERPX_PATCH
unsigned int seltags;
unsigned int sellt;
@@ -568,9 +568,6 @@ typedef struct {
#if RENAMED_SCRATCHPADS_PATCH
const char scratchkey;
#endif // RENAMED_SCRATCHPADS_PATCH
#if UNMANAGED_PATCH
int unmanaged;
#endif // UNMANAGED_PATCH
#if XKB_PATCH
int xkb_layout;
#endif // XKB_PATCH
@@ -778,9 +775,6 @@ static int xkbEventType = 0;
static int screen;
static int sw, sh; /* X display screen geometry width, height */
static int bh; /* bar geometry */
#if UNMANAGED_PATCH
static int unmanaged = 0; /* whether the window manager should manage the new window or not */
#endif // UNMANAGED_PATCH
static int lrpad; /* sum of left and right padding for text */
/* Some clients (e.g. alacritty) helpfully send configure requests with a new size or position
* when they detect that they have been moved to another monitor. This can cause visual glitches
@@ -938,9 +932,6 @@ applyrules(Client *c)
c->y = c->mon->wy + (c->mon->wh / 2 - HEIGHT(c) / 2);
}
#endif // SCRATCHPADS_PATCH
#if UNMANAGED_PATCH
unmanaged = r->unmanaged;
#endif // UNMANAGED_PATCH
for (m = mons; m && m->num != r->monitor; m = m->next);
if (m)
c->mon = m;
@@ -974,7 +965,12 @@ applyrules(Client *c)
if (r->switchtag == 3 || r->switchtag == 4)
c->switchtag = c->mon->tagset[c->mon->seltags];
if (r->switchtag == 1 || r->switchtag == 3) {
#if PERTAG_PATCH
pertagview(&((Arg) { .ui = newtagset }));
arrange(c->mon);
#else
view(&((Arg) { .ui = newtagset }));
#endif // PERTAG_PATCH
} else {
#if TAGSYNC_PATCH
for (m = mons; m; m = m->next)
@@ -1498,8 +1494,8 @@ configurenotify(XEvent *e)
createpreview(m);
#endif // BAR_TAGPREVIEW_PATCH
}
arrange(NULL);
focus(NULL);
arrange(NULL);
}
}
}
@@ -1685,7 +1681,7 @@ createmon(void)
bar->showbar = 1;
bar->external = 0;
#if BAR_BORDER_PATCH
bar->borderpx = (barborderpx ? barborderpx : borderpx);
bar->borderpx = borderpx;
#else
bar->borderpx = 0;
#endif // BAR_BORDER_PATCH
@@ -2046,10 +2042,6 @@ expose(XEvent *e)
void
focus(Client *c)
{
#if FOCUSFOLLOWMOUSE_PATCH
if (!c || !ISVISIBLE(c))
c = getpointerclient();
#endif // FOCUSFOLLOWMOUSE_PATCH
if (!c || !ISVISIBLE(c))
for (c = selmon->stack; c && !ISVISIBLE(c); c = c->snext);
if (selmon->sel && selmon->sel != c)
@@ -2511,25 +2503,6 @@ manage(Window w, XWindowAttributes *wa)
#endif // SWALLOW_PATCH
}
#if UNMANAGED_PATCH
if (unmanaged) {
XMapWindow(dpy, c->win);
if (unmanaged == 1)
XRaiseWindow(dpy, c->win);
else if (unmanaged == 2)
XLowerWindow(dpy, c->win);
updatewmhints(c);
if (!c->neverfocus)
XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
sendevent(c, wmatom[WMTakeFocus]);
free(c);
unmanaged = 0;
return;
}
#endif // UNMANAGED_PATCH
if (c->x + WIDTH(c) > c->mon->wx + c->mon->ww)
c->x = c->mon->wx + c->mon->ww - WIDTH(c);
if (c->y + HEIGHT(c) > c->mon->wy + c->mon->wh)
@@ -3379,12 +3352,11 @@ sendmon(Client *c, Monitor *m)
if (hadfocus) {
focus(c);
restack(m);
} else {
} else
focus(NULL);
}
#else
arrange(NULL);
focus(NULL);
arrange(NULL);
#endif // EXRESIZE_PATCH / SENDMON_KEEPFOCUS_PATCH
#if SWITCHTAG_PATCH
if (c->switchtag)
@@ -4107,7 +4079,6 @@ tag(const Arg *arg)
if (selmon->sel->switchtag)
selmon->sel->switchtag = 0;
#endif // SWITCHTAG_PATCH
arrange(selmon);
focus(NULL);
#if SWAPFOCUS_PATCH && PERTAG_PATCH
selmon->pertag->prevclient[selmon->pertag->curtag] = NULL;
@@ -4115,6 +4086,7 @@ tag(const Arg *arg)
if (tagmask & 1)
selmon->pertag->prevclient[tagindex] = NULL;
#endif // SWAPFOCUS_PATCH
arrange(selmon);
#if VIEWONTAG_PATCH
if ((arg->ui & TAGMASK) != selmon->tagset[selmon->seltags])
view(arg);
@@ -4246,13 +4218,13 @@ toggletag(const Arg *arg)
newtags = selmon->sel->tags ^ (arg->ui & TAGMASK);
if (newtags) {
selmon->sel->tags = newtags;
arrange(selmon);
focus(NULL);
#if SWAPFOCUS_PATCH && PERTAG_PATCH
for (tagmask = arg->ui & TAGMASK, tagindex = 1; tagmask!=0; tagmask >>= 1, tagindex++)
if (tagmask & 1)
selmon->pertag->prevclient[tagindex] = NULL;
#endif // SWAPFOCUS_PATCH
arrange(selmon);
}
#if BAR_EWMHTAGS_PATCH
updatecurrentdesktop();
@@ -4339,8 +4311,8 @@ toggleview(const Arg *arg)
#endif // PERTAGBAR_PATCH
#endif // PERTAG_PATCH
#if !TAGSYNC_PATCH
arrange(selmon);
focus(NULL);
arrange(selmon);
#endif // TAGSYNC_PATCH
#if !EMPTYVIEW_PATCH
}
@@ -4351,8 +4323,8 @@ toggleview(const Arg *arg)
#if !EMPTYVIEW_PATCH
if (newtagset) {
#endif // EMPTYVIEW_PATCH
arrange(NULL);
focus(NULL);
arrange(NULL);
#if !EMPTYVIEW_PATCH
}
#endif // EMPTYVIEW_PATCH
@@ -4489,9 +4461,9 @@ unmanage(Client *c, int destroyed)
if (s)
return;
#endif // SWALLOW_PATCH
arrange(m);
focus(NULL);
updateclientlist();
arrange(m);
#if SWITCHTAG_PATCH
if (switchtag && ((switchtag & TAGMASK) != selmon->tagset[selmon->seltags]))
view(&((Arg) { .ui = switchtag }));
@@ -4986,12 +4958,12 @@ view(const Arg *arg)
}
selmon = origselmon;
#endif // TAGSYNC_PATCH
focus(NULL);
#if TAGSYNC_PATCH
arrange(NULL);
#else
arrange(selmon);
#endif // TAGSYNC_PATCH
focus(NULL);
#if BAR_EWMHTAGS_PATCH
updatecurrentdesktop();
#endif // BAR_EWMHTAGS_PATCH