mirror of
https://github.com/eRgo35/dwm.git
synced 2025-12-16 13:46:11 +01:00
BREAKING-CHANGE: fresh start; all mods removed; synced to master
This commit is contained in:
276
dwm.c
276
dwm.c
@@ -101,7 +101,6 @@
|
||||
#else
|
||||
#define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags]))
|
||||
#endif // ATTACHASIDE_PATCH
|
||||
#define LENGTH(X) (sizeof X / sizeof X[0])
|
||||
#define MOUSEMASK (BUTTONMASK|PointerMotionMask)
|
||||
#define WIDTH(X) ((X)->w + 2 * (X)->bw)
|
||||
#define HEIGHT(X) ((X)->h + 2 * (X)->bw)
|
||||
@@ -482,9 +481,12 @@ struct Monitor {
|
||||
int gappiv; /* vertical gap between windows */
|
||||
int gappoh; /* horizontal outer gaps */
|
||||
int gappov; /* vertical outer gaps */
|
||||
#if PERMON_VANITYGAPS_PATCH
|
||||
int enablegaps; /* whether gaps are enabled */
|
||||
#endif // PERMON_VANITYGAPS_PATCH
|
||||
#endif // VANITYGAPS_PATCH
|
||||
#if SETBORDERPX_PATCH
|
||||
unsigned int borderpx;
|
||||
int borderpx;
|
||||
#endif // SETBORDERPX_PATCH
|
||||
unsigned int seltags;
|
||||
unsigned int sellt;
|
||||
@@ -504,6 +506,9 @@ struct Monitor {
|
||||
Client *clients;
|
||||
Client *sel;
|
||||
Client *stack;
|
||||
#if FOCUSMASTER_RETURN_PATCH
|
||||
Client *tagmarked[32];
|
||||
#endif // FOCUSMASTER_RETURN_PATCH
|
||||
Monitor *next;
|
||||
Bar *bar;
|
||||
const Layout *lt[2];
|
||||
@@ -568,13 +573,23 @@ 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
|
||||
#if BORDER_RULE_PATCH
|
||||
int bw;
|
||||
#endif // BORDER_RULE_PATCH
|
||||
} Rule;
|
||||
|
||||
#if XKB_PATCH
|
||||
#if BORDER_RULE_PATCH && XKB_PATCH
|
||||
#define RULE(...) { .monitor = -1, .xkb_layout = -1, .bw = -1, __VA_ARGS__ },
|
||||
#elif XKB_PATCH
|
||||
#define RULE(...) { .monitor = -1, .xkb_layout = -1, __VA_ARGS__ },
|
||||
#elif BORDER_RULE_PATCH
|
||||
#define RULE(...) { .monitor = -1, .bw = -1, __VA_ARGS__ },
|
||||
#else
|
||||
#define RULE(...) { .monitor = -1, __VA_ARGS__ },
|
||||
#endif // XKB_PATCH
|
||||
@@ -676,11 +691,12 @@ static void killclient(const Arg *arg);
|
||||
static void manage(Window w, XWindowAttributes *wa);
|
||||
static void mappingnotify(XEvent *e);
|
||||
static void maprequest(XEvent *e);
|
||||
#if !FOCUSONCLICK_PATCH
|
||||
static void motionnotify(XEvent *e);
|
||||
#endif // FOCUSONCLICK_PATCH
|
||||
static void movemouse(const Arg *arg);
|
||||
static Client *nexttiled(Client *c);
|
||||
#if NOBORDER_PATCH
|
||||
static int noborder(Client *c);
|
||||
#endif // NOBORDER_PATCH
|
||||
#if !ZOOMSWAP_PATCH || TAGINTOSTACK_ALLMASTER_PATCH || TAGINTOSTACK_ONEMASTER_PATCH
|
||||
static void pop(Client *c);
|
||||
#endif // !ZOOMSWAP_PATCH / TAGINTOSTACK_ALLMASTER_PATCH / TAGINTOSTACK_ONEMASTER_PATCH
|
||||
@@ -775,6 +791,9 @@ 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
|
||||
@@ -811,9 +830,7 @@ static void (*handler[LASTEvent]) (XEvent *) = {
|
||||
#endif // COMBO_PATCH / BAR_HOLDBAR_PATCH
|
||||
[MappingNotify] = mappingnotify,
|
||||
[MapRequest] = maprequest,
|
||||
#if !FOCUSONCLICK_PATCH
|
||||
[MotionNotify] = motionnotify,
|
||||
#endif // FOCUSONCLICK_PATCH
|
||||
[PropertyNotify] = propertynotify,
|
||||
#if BAR_SYSTRAY_PATCH
|
||||
[ResizeRequest] = resizerequest,
|
||||
@@ -909,6 +926,10 @@ applyrules(Client *c)
|
||||
#if CENTER_PATCH
|
||||
c->iscentered = r->iscentered;
|
||||
#endif // CENTER_PATCH
|
||||
#if BORDER_RULE_PATCH
|
||||
if (r->bw != -1)
|
||||
c->bw = r->bw;
|
||||
#endif // BORDER_RULE_PATCH
|
||||
#if ISPERMANENT_PATCH
|
||||
c->ispermanent = r->ispermanent;
|
||||
#endif // ISPERMANENT_PATCH
|
||||
@@ -932,6 +953,9 @@ 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;
|
||||
@@ -954,6 +978,7 @@ applyrules(Client *c)
|
||||
if (r->switchtag)
|
||||
#endif // SWALLOW_PATCH
|
||||
{
|
||||
unfocus(selmon->sel, 1, NULL);
|
||||
selmon = c->mon;
|
||||
if (r->switchtag == 2 || r->switchtag == 4)
|
||||
newtagset = c->mon->tagset[c->mon->seltags] ^ c->tags;
|
||||
@@ -965,12 +990,7 @@ 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)
|
||||
@@ -1102,6 +1122,11 @@ arrange(Monitor *m)
|
||||
void
|
||||
arrangemon(Monitor *m)
|
||||
{
|
||||
#if BAR_PADDING_SMART_PATCH
|
||||
updatebarpos(selmon);
|
||||
for (Bar *bar = selmon->bar; bar; bar = bar->next)
|
||||
XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh);
|
||||
#endif // BAR_PADDING_SMART_PATCH
|
||||
#if TAB_PATCH
|
||||
updatebarpos(m);
|
||||
XMoveResizeWindow(dpy, m->tabwin, m->wx, m->ty, m->ww, th);
|
||||
@@ -1455,6 +1480,15 @@ configure(Client *c)
|
||||
ce.width = c->w;
|
||||
ce.height = c->h;
|
||||
ce.border_width = c->bw;
|
||||
|
||||
#if NOBORDER_PATCH
|
||||
if (noborder(c)) {
|
||||
ce.width += c->bw * 2;
|
||||
ce.height += c->bw * 2;
|
||||
ce.border_width = 0;
|
||||
}
|
||||
#endif // NOBORDER_PATCH
|
||||
|
||||
ce.above = None;
|
||||
ce.override_redirect = False;
|
||||
XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&ce);
|
||||
@@ -1494,8 +1528,8 @@ configurenotify(XEvent *e)
|
||||
createpreview(m);
|
||||
#endif // BAR_TAGPREVIEW_PATCH
|
||||
}
|
||||
focus(NULL);
|
||||
arrange(NULL);
|
||||
focus(NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1681,7 +1715,7 @@ createmon(void)
|
||||
bar->showbar = 1;
|
||||
bar->external = 0;
|
||||
#if BAR_BORDER_PATCH
|
||||
bar->borderpx = borderpx;
|
||||
bar->borderpx = (barborderpx ? barborderpx : borderpx);
|
||||
#else
|
||||
bar->borderpx = 0;
|
||||
#endif // BAR_BORDER_PATCH
|
||||
@@ -1766,6 +1800,10 @@ createmon(void)
|
||||
}
|
||||
#endif // PERTAG_PATCH
|
||||
|
||||
#if PERMON_VANITYGAPS_PATCH
|
||||
m->enablegaps = 1;
|
||||
#endif // PERMON_VANITYGAPS_PATCH
|
||||
|
||||
#if SEAMLESS_RESTART_PATCH
|
||||
restoremonitorstate(m);
|
||||
#endif // SEAMLESS_RESTART_PATCH
|
||||
@@ -1818,6 +1856,11 @@ detach(Client *c)
|
||||
#if SEAMLESS_RESTART_PATCH
|
||||
c->idx = 0;
|
||||
#endif // SEAMLESS_RESTART_PATCH
|
||||
#if FOCUSMASTER_RETURN_PATCH
|
||||
for (int i = 1; i < NUMTAGS; i++)
|
||||
if (c == c->mon->tagmarked[i])
|
||||
c->mon->tagmarked[i] = NULL;
|
||||
#endif // FOCUSMASTER_RETURN_PATCH
|
||||
|
||||
for (tc = &c->mon->clients; *tc && *tc != c; tc = &(*tc)->next);
|
||||
*tc = c->next;
|
||||
@@ -2042,6 +2085,14 @@ expose(XEvent *e)
|
||||
void
|
||||
focus(Client *c)
|
||||
{
|
||||
#if FOCUSFOLLOWMOUSE_PATCH
|
||||
if (!c || !ISVISIBLE(c))
|
||||
c = getpointerclient();
|
||||
#endif // FOCUSFOLLOWMOUSE_PATCH
|
||||
#if STICKY_PATCH
|
||||
if (!c || !ISVISIBLE(c))
|
||||
for (c = selmon->stack; c && (!ISVISIBLE(c) || c->issticky); c = c->snext);
|
||||
#endif // STICKY_PATCH
|
||||
if (!c || !ISVISIBLE(c))
|
||||
for (c = selmon->stack; c && !ISVISIBLE(c); c = c->snext);
|
||||
if (selmon->sel && selmon->sel != c)
|
||||
@@ -2476,8 +2527,10 @@ manage(Window w, XWindowAttributes *wa)
|
||||
#endif // CENTER_TRANSIENT_WINDOWS_PATCH | CENTER_TRANSIENT_WINDOWS_BY_PARENT_PATCH | CENTER_PATCH
|
||||
} else {
|
||||
#if SEAMLESS_RESTART_PATCH
|
||||
if (!settings_restored)
|
||||
if (!settings_restored || c->mon == NULL) {
|
||||
c->mon = selmon;
|
||||
settings_restored = 0;
|
||||
}
|
||||
#else
|
||||
c->mon = selmon;
|
||||
#endif // SEAMLESS_RESTART_PATCH
|
||||
@@ -2503,6 +2556,29 @@ 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);
|
||||
#if BAR_SYSTRAY_PATCH
|
||||
sendevent(c->win, wmatom[WMTakeFocus], NoEventMask, wmatom[WMTakeFocus], CurrentTime, 0, 0, 0);
|
||||
#else
|
||||
sendevent(c, wmatom[WMTakeFocus]);
|
||||
#endif // BAR_SYSTRAY_PATCH
|
||||
|
||||
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)
|
||||
@@ -2671,16 +2747,17 @@ maprequest(XEvent *e)
|
||||
manage(ev->window, &wa);
|
||||
}
|
||||
|
||||
#if !FOCUSONCLICK_PATCH
|
||||
void
|
||||
motionnotify(XEvent *e)
|
||||
{
|
||||
#if !FOCUSONCLICK_PATCH
|
||||
static Monitor *mon = NULL;
|
||||
Monitor *m;
|
||||
Bar *bar;
|
||||
#if LOSEFULLSCREEN_PATCH
|
||||
Client *sel;
|
||||
#endif // LOSEFULLSCREEN_PATCH
|
||||
#endif // FOCUSONCLICK_PATCH
|
||||
Bar *bar;
|
||||
XMotionEvent *ev = &e->xmotion;
|
||||
|
||||
if ((bar = wintobar(ev->window))) {
|
||||
@@ -2693,6 +2770,7 @@ motionnotify(XEvent *e)
|
||||
hidetagpreview(selmon);
|
||||
#endif // BAR_TAGPREVIEW_PATCH
|
||||
|
||||
#if !FOCUSONCLICK_PATCH
|
||||
if (ev->window != root)
|
||||
return;
|
||||
if ((m = recttomon(ev->x_root, ev->y_root, 1, 1)) != mon && mon) {
|
||||
@@ -2707,8 +2785,8 @@ motionnotify(XEvent *e)
|
||||
focus(NULL);
|
||||
}
|
||||
mon = m;
|
||||
#endif // FOCUSONCLICK_PATCH
|
||||
}
|
||||
#endif // FOCUSONCLICK_PATCH
|
||||
|
||||
void
|
||||
movemouse(const Arg *arg)
|
||||
@@ -2809,10 +2887,63 @@ nexttiled(Client *c)
|
||||
return c;
|
||||
}
|
||||
|
||||
#if NOBORDER_PATCH
|
||||
int
|
||||
noborder(Client *c)
|
||||
{
|
||||
int monocle_layout = 0;
|
||||
|
||||
#if MONOCLE_LAYOUT
|
||||
if (&monocle == c->mon->lt[c->mon->sellt]->arrange)
|
||||
monocle_layout = 1;
|
||||
#endif // MONOCLE_LAYOUT
|
||||
|
||||
#if DECK_LAYOUT
|
||||
if (&deck == c->mon->lt[c->mon->sellt]->arrange && c->mon->nmaster == 0)
|
||||
monocle_layout = 1;
|
||||
#endif // DECK_LAYOUT
|
||||
|
||||
#if FLEXTILE_DELUXE_LAYOUT
|
||||
if (&flextile == c->mon->lt[c->mon->sellt]->arrange && (
|
||||
(c->mon->ltaxis[LAYOUT] == NO_SPLIT && c->mon->ltaxis[MASTER] == MONOCLE) ||
|
||||
(c->mon->ltaxis[STACK] == MONOCLE && c->mon->nmaster == 0)
|
||||
)) {
|
||||
monocle_layout = 1;
|
||||
}
|
||||
#endif //FLEXTILE_DELUXE_LAYOUT
|
||||
|
||||
if (!monocle_layout && (nexttiled(c->mon->clients) != c || nexttiled(c->next)))
|
||||
return 0;
|
||||
|
||||
if (c->isfloating)
|
||||
return 0;
|
||||
|
||||
if (!c->mon->lt[c->mon->sellt]->arrange)
|
||||
return 0;
|
||||
|
||||
#if FAKEFULLSCREEN_CLIENT_PATCH && !FAKEFULLSCREEN_PATCH
|
||||
if (c->fakefullscreen != 1 && c->isfullscreen)
|
||||
return 0;
|
||||
#elif !FAKEFULLSCREEN_PATCH
|
||||
if (c->isfullscreen)
|
||||
return 0;
|
||||
#endif // FAKEFULLSCREEN_CLIENT_PATCH
|
||||
|
||||
return 1;
|
||||
}
|
||||
#endif // NOBORDER_PATCH
|
||||
|
||||
#if !ZOOMSWAP_PATCH || TAGINTOSTACK_ALLMASTER_PATCH || TAGINTOSTACK_ONEMASTER_PATCH
|
||||
void
|
||||
pop(Client *c)
|
||||
{
|
||||
#if FOCUSMASTER_RETURN_PATCH
|
||||
int i;
|
||||
for (i = 0; !(selmon->tagset[selmon->seltags] & 1 << i); i++);
|
||||
i++;
|
||||
|
||||
c->mon->tagmarked[i] = nexttiled(c->mon->clients);
|
||||
#endif // FOCUSMASTER_RETURN_PATCH
|
||||
detach(c);
|
||||
attach(c);
|
||||
focus(c);
|
||||
@@ -2956,31 +3087,9 @@ resizeclient(Client *c, int x, int y, int w, int h)
|
||||
drawroundedcorners(c);
|
||||
#endif // ROUNDED_CORNERS_PATCH
|
||||
#if NOBORDER_PATCH
|
||||
if (((nexttiled(c->mon->clients) == c && !nexttiled(c->next))
|
||||
#if MONOCLE_LAYOUT
|
||||
|| &monocle == c->mon->lt[c->mon->sellt]->arrange
|
||||
#endif // MONOCLE_LAYOUT
|
||||
#if DECK_LAYOUT
|
||||
|| (&deck == c->mon->lt[c->mon->sellt]->arrange &&
|
||||
c->mon->nmaster == 0)
|
||||
#endif // DECK_LAYOUT
|
||||
#if FLEXTILE_DELUXE_LAYOUT
|
||||
|| (&flextile == c->mon->lt[c->mon->sellt]->arrange && (
|
||||
(c->mon->ltaxis[LAYOUT] == NO_SPLIT &&
|
||||
c->mon->ltaxis[MASTER] == MONOCLE) ||
|
||||
(c->mon->ltaxis[STACK] == MONOCLE &&
|
||||
c->mon->nmaster == 0)))
|
||||
#endif //FLEXTILE_DELUXE_LAYOUT
|
||||
)
|
||||
#if FAKEFULLSCREEN_CLIENT_PATCH && !FAKEFULLSCREEN_PATCH
|
||||
&& (c->fakefullscreen == 1 || !c->isfullscreen)
|
||||
#else
|
||||
&& !c->isfullscreen
|
||||
#endif // FAKEFULLSCREEN_CLIENT_PATCH
|
||||
&& !c->isfloating
|
||||
&& c->mon->lt[c->mon->sellt]->arrange) {
|
||||
c->w = wc.width += c->bw * 2;
|
||||
c->h = wc.height += c->bw * 2;
|
||||
if (noborder(c)) {
|
||||
wc.width += c->bw * 2;
|
||||
wc.height += c->bw * 2;
|
||||
wc.border_width = 0;
|
||||
}
|
||||
#endif // NOBORDER_PATCH
|
||||
@@ -3214,7 +3323,6 @@ run(void)
|
||||
event_fd, events[i].data.ptr, events[i].data.u32,
|
||||
events[i].data.u64);
|
||||
fprintf(stderr, " with events %d\n", events[i].events);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3335,6 +3443,14 @@ sendmon(Client *c, Monitor *m)
|
||||
#else
|
||||
c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
|
||||
#endif // EMPTYVIEW_PATCH
|
||||
#if SENDMON_CENTER_PATCH
|
||||
c->x = m->mx + (m->mw - WIDTH(c)) / 2;
|
||||
c->y = m->my + (m->mh - HEIGHT(c)) / 2;
|
||||
#if SAVEFLOATS_PATCH
|
||||
c->sfx = m->mx + (m->mw - c->sfw - 2 * c->bw) / 2;
|
||||
c->sfy = m->my + (m->mh - c->sfh - 2 * c->bw) / 2;
|
||||
#endif // SAVEFLOATS_PATCH
|
||||
#endif // SENDMON_CENTER_PATCH
|
||||
#if ATTACHABOVE_PATCH || ATTACHASIDE_PATCH || ATTACHBELOW_PATCH || ATTACHBOTTOM_PATCH
|
||||
attachx(c);
|
||||
#else
|
||||
@@ -3352,11 +3468,12 @@ sendmon(Client *c, Monitor *m)
|
||||
if (hadfocus) {
|
||||
focus(c);
|
||||
restack(m);
|
||||
} else
|
||||
} else {
|
||||
focus(NULL);
|
||||
}
|
||||
#else
|
||||
focus(NULL);
|
||||
arrange(NULL);
|
||||
focus(NULL);
|
||||
#endif // EXRESIZE_PATCH / SENDMON_KEEPFOCUS_PATCH
|
||||
#if SWITCHTAG_PATCH
|
||||
if (c->switchtag)
|
||||
@@ -4079,6 +4196,7 @@ 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;
|
||||
@@ -4086,7 +4204,6 @@ 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);
|
||||
@@ -4176,10 +4293,21 @@ togglefloating(const Arg *arg)
|
||||
#endif // !FAKEFULLSCREEN_PATCH
|
||||
c->isfloating = !c->isfloating || c->isfixed;
|
||||
#if !BAR_FLEXWINTITLE_PATCH
|
||||
#if RENAMED_SCRATCHPADS_PATCH
|
||||
if (c->scratchkey != 0 && c->isfloating)
|
||||
XSetWindowBorder(dpy, c->win, scheme[SchemeScratchSel][ColFloat].pixel);
|
||||
else if (c->scratchkey != 0)
|
||||
XSetWindowBorder(dpy, c->win, scheme[SchemeScratchSel][ColBorder].pixel);
|
||||
else if (c->isfloating)
|
||||
XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColFloat].pixel);
|
||||
else
|
||||
XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColBorder].pixel);
|
||||
#else
|
||||
if (c->isfloating)
|
||||
XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColFloat].pixel);
|
||||
else
|
||||
XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColBorder].pixel);
|
||||
#endif // RENAMED_SCRATCHPADS_PATCH
|
||||
#endif // BAR_FLEXWINTITLE_PATCH
|
||||
if (c->isfloating) {
|
||||
#if SAVEFLOATS_PATCH || EXRESIZE_PATCH
|
||||
@@ -4218,13 +4346,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();
|
||||
@@ -4311,8 +4439,8 @@ toggleview(const Arg *arg)
|
||||
#endif // PERTAGBAR_PATCH
|
||||
#endif // PERTAG_PATCH
|
||||
#if !TAGSYNC_PATCH
|
||||
focus(NULL);
|
||||
arrange(selmon);
|
||||
focus(NULL);
|
||||
#endif // TAGSYNC_PATCH
|
||||
#if !EMPTYVIEW_PATCH
|
||||
}
|
||||
@@ -4323,8 +4451,8 @@ toggleview(const Arg *arg)
|
||||
#if !EMPTYVIEW_PATCH
|
||||
if (newtagset) {
|
||||
#endif // EMPTYVIEW_PATCH
|
||||
focus(NULL);
|
||||
arrange(NULL);
|
||||
focus(NULL);
|
||||
#if !EMPTYVIEW_PATCH
|
||||
}
|
||||
#endif // EMPTYVIEW_PATCH
|
||||
@@ -4343,13 +4471,24 @@ unfocus(Client *c, int setfocus, Client *nextfocus)
|
||||
selmon->pertag->prevclient[selmon->pertag->curtag] = c;
|
||||
#endif // SWAPFOCUS_PATCH
|
||||
#if LOSEFULLSCREEN_PATCH
|
||||
if (c->isfullscreen && ISVISIBLE(c) && c->mon == selmon && nextfocus && !nextfocus->isfloating)
|
||||
if (c->isfullscreen && ISVISIBLE(c) && c->mon == selmon && nextfocus && !nextfocus->isfloating) {
|
||||
#if RENAMED_SCRATCHPADS_PATCH && RENAMED_SCRATCHPADS_AUTO_HIDE_PATCH
|
||||
#if FAKEFULLSCREEN_CLIENT_PATCH
|
||||
if (c->scratchkey != 0 && c->fakefullscreen != 1)
|
||||
togglescratch(&((Arg) {.v = (const char*[]){ &c->scratchkey, NULL } }));
|
||||
#else
|
||||
if (c->scratchkey != 0)
|
||||
togglescratch(&((Arg) {.v = (const char*[]){ &c->scratchkey, NULL } }));
|
||||
#endif // FAKEFULLSCREEN_CLIENT_PATCH
|
||||
else
|
||||
#endif // RENAMED_SCRATCHPADS_AUTO_HIDE_PATCH
|
||||
#if FAKEFULLSCREEN_CLIENT_PATCH
|
||||
if (c->fakefullscreen != 1)
|
||||
setfullscreen(c, 0);
|
||||
#else
|
||||
setfullscreen(c, 0);
|
||||
#endif // #if FAKEFULLSCREEN_CLIENT_PATCH
|
||||
}
|
||||
#endif // LOSEFULLSCREEN_PATCH
|
||||
grabbuttons(c, 0);
|
||||
#if !BAR_FLEXWINTITLE_PATCH
|
||||
@@ -4461,9 +4600,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 }));
|
||||
@@ -4583,16 +4722,36 @@ updatebarpos(Monitor *m)
|
||||
#if BAR_PADDING_VANITYGAPS_PATCH && VANITYGAPS_PATCH
|
||||
#if PERTAG_VANITYGAPS_PATCH && PERTAG_PATCH
|
||||
if (!selmon || selmon->pertag->enablegaps[selmon->pertag->curtag])
|
||||
#elif PERMON_VANITYGAPS_PATCH
|
||||
if (!selmon || selmon->enablegaps)
|
||||
#else
|
||||
if (enablegaps)
|
||||
#endif // PERTAG_VANITYGAPS_PATCH
|
||||
{
|
||||
#if BAR_PADDING_SMART_PATCH
|
||||
unsigned int n; Client *c;
|
||||
for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
|
||||
if (n > 1) {
|
||||
y_pad = gappoh;
|
||||
x_pad = gappov;
|
||||
}
|
||||
#else
|
||||
y_pad = gappoh;
|
||||
x_pad = gappov;
|
||||
#endif // BAR_PADDING_SMART_PATCH
|
||||
}
|
||||
#elif BAR_PADDING_PATCH
|
||||
#if BAR_PADDING_SMART_PATCH
|
||||
unsigned int n; Client *c;
|
||||
for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
|
||||
if (n > 1) {
|
||||
y_pad = vertpad;
|
||||
x_pad = sidepad;
|
||||
}
|
||||
#else
|
||||
y_pad = vertpad;
|
||||
x_pad = sidepad;
|
||||
#endif // BAR_PADDING_SMART_PATCH
|
||||
#endif // BAR_PADDING_PATCH | BAR_PADDING_VANITYGAPS_PATCH
|
||||
|
||||
#if INSETS_PATCH
|
||||
@@ -4647,7 +4806,7 @@ updatebarpos(Monitor *m)
|
||||
}
|
||||
|
||||
void
|
||||
updateclientlist()
|
||||
updateclientlist(void)
|
||||
{
|
||||
Client *c;
|
||||
Monitor *m;
|
||||
@@ -4958,12 +5117,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
|
||||
@@ -5041,6 +5200,9 @@ void
|
||||
zoom(const Arg *arg)
|
||||
{
|
||||
Client *c = selmon->sel;
|
||||
#if FOCUSMASTER_RETURN_PATCH && ZOOMSWAP_PATCH
|
||||
int i;
|
||||
#endif // FOCUSMASTER_RETURN_PATCH
|
||||
if (arg && arg->v)
|
||||
c = (Client*)arg->v;
|
||||
if (!c)
|
||||
@@ -5094,6 +5256,12 @@ zoom(const Arg *arg)
|
||||
cold = nexttiled(c->mon->clients);
|
||||
if (c != cold && !at)
|
||||
at = findbefore(c);
|
||||
#if FOCUSMASTER_RETURN_PATCH
|
||||
for (i = 0; !(selmon->tagset[selmon->seltags] & 1 << i); i++);
|
||||
i++;
|
||||
|
||||
c->mon->tagmarked[i] = cold;
|
||||
#endif // FOCUSMASTER_RETURN_PATCH
|
||||
detach(c);
|
||||
attach(c);
|
||||
/* swap windows instead of pushing the previous one down */
|
||||
|
||||
Reference in New Issue
Block a user