[wiki] [sites] Bugfixes for the swallow patch || Petr Šabata
commit 16f7cc38898f70687c1e13ba0ed2cff9216ef871
Author: Petr Šabata <contyk_AT_redhat.com>
Date: Fri Mar 9 19:16:58 2018 +0100
Bugfixes for the swallow patch
Do not call arrange if the new window is being swallowed, reducing
unnecessary resizing and flickering.
Re-focus the parent window after the client exited so that the border is
redrawn correctly.
Signed-off-by: Petr Šabata <contyk_AT_redhat.com>
diff --git a/dwm.suckless.org/patches/swallow/dwm-swallow-6.1.diff b/dwm.suckless.org/patches/swallow/dwm-swallow-6.1.diff
index 7c3001fb..684735a4 100644
--- a/dwm.suckless.org/patches/swallow/dwm-swallow-6.1.diff
+++ b/dwm.suckless.org/patches/swallow/dwm-swallow-6.1.diff
_AT_@ -30,7 +30,7 @@ index 4eefb71..34ea872 100644
# flags
CPPFLAGS = -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
diff --git a/dwm.c b/dwm.c
-index 0362114..566491a 100644
+index 0362114..1d38293 100644
--- a/dwm.c
+++ b/dwm.c
_AT_@ -40,6 +40,8 @@
_AT_@ -115,10 +115,11 @@ index 0362114..566491a 100644
c->isfloating = r->isfloating;
c->tags |= r->tags;
for (m = mons; m && m->num != r->monitor; m = m->next);
-_AT_@ -413,6 +427,47 @@ attachstack(Client *c)
+_AT_@ -412,6 +426,48 @@ attachstack(Client *c)
+ c->mon->stack = c;
}
- void
++void
+swallow(Client *p, Client *c)
+{
+ if (c->noswallow || c->isterminal)
_AT_@ -157,13 +158,13 @@ index 0362114..566491a 100644
+ XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
+ configure(c);
+ setclientstate(c, NormalState);
++ focus(c);
+}
+
-+void
+ void
buttonpress(XEvent *e)
{
- unsigned int i, x, click;
-_AT_@ -475,7 +529,7 @@ cleanup(void)
+_AT_@ -475,7 +531,7 @@ cleanup(void)
selmon->lt[selmon->sellt] = &foo;
for (m = mons; m; m = m->next)
while (m->stack)
_AT_@ -172,7 +173,7 @@ index 0362114..566491a 100644
XUngrabKey(dpy, AnyKey, AnyModifier, root);
while (mons)
cleanupmon(mons);
-_AT_@ -661,6 +715,9 @@ destroynotify(XEvent *e)
+_AT_@ -661,6 +717,9 @@ destroynotify(XEvent *e)
if ((c = wintoclient(ev->window)))
unmanage(c, 1);
_AT_@ -182,7 +183,7 @@ index 0362114..566491a 100644
}
void
-_AT_@ -1032,12 +1089,13 @@ killclient(const Arg *arg)
+_AT_@ -1032,12 +1091,13 @@ killclient(const Arg *arg)
void
manage(Window w, XWindowAttributes *wa)
{
_AT_@ -197,7 +198,7 @@ index 0362114..566491a 100644
updatetitle(c);
if (XGetTransientForHint(dpy, w, &trans) && (t = wintoclient(trans))) {
c->mon = t->mon;
-_AT_@ -1045,7 +1103,9 @@ manage(Window w, XWindowAttributes *wa)
+_AT_@ -1045,7 +1105,9 @@ manage(Window w, XWindowAttributes *wa)
} else {
c->mon = selmon;
applyrules(c);
_AT_@ -207,16 +208,20 @@ index 0362114..566491a 100644
/* geometry */
c->x = c->oldx = wa->x;
c->y = c->oldy = wa->y;
-_AT_@ -1087,6 +1147,8 @@ manage(Window w, XWindowAttributes *wa)
+_AT_@ -1085,8 +1147,11 @@ manage(Window w, XWindowAttributes *wa)
+ if (c->mon == selmon)
+ unfocus(selmon->sel, 0);
c->mon->sel = c;
- arrange(c->mon);
+- arrange(c->mon);
++ if (!term)
++ arrange(c->mon);
XMapWindow(dpy, c->win);
+ if (term)
+ swallow(term, c);
focus(NULL);
}
-_AT_@ -1758,6 +1820,20 @@ unmanage(Client *c, int destroyed)
+_AT_@ -1758,6 +1823,20 @@ unmanage(Client *c, int destroyed)
Monitor *m = c->mon;
XWindowChanges wc;
_AT_@ -237,7 +242,7 @@ index 0362114..566491a 100644
/* The server grab construct avoids race conditions. */
detach(c);
detachstack(c);
-_AT_@ -1773,9 +1849,12 @@ unmanage(Client *c, int destroyed)
+_AT_@ -1773,9 +1852,12 @@ unmanage(Client *c, int destroyed)
XUngrabServer(dpy);
}
free(c);
_AT_@ -253,7 +258,7 @@ index 0362114..566491a 100644
}
void
-_AT_@ -2040,16 +2119,116 @@ view(const Arg *arg)
+_AT_@ -2040,16 +2122,116 @@ view(const Arg *arg)
arrange(selmon);
}
_AT_@ -372,7 +377,7 @@ index 0362114..566491a 100644
return NULL;
}
-_AT_@ -2131,6 +2310,8 @@ main(int argc, char *argv[])
+_AT_@ -2131,6 +2313,8 @@ main(int argc, char *argv[])
fputs("warning: no locale support
", stderr);
if (!(dpy = XOpenDisplay(NULL)))
die("dwm: cannot open display
");
diff --git a/dwm.suckless.org/patches/swallow/index.md b/dwm.suckless.org/patches/swallow/index.md
index 7cb4c67e..c8da1125 100644
--- a/dwm.suckless.org/patches/swallow/index.md
+++ b/dwm.suckless.org/patches/swallow/index.md
_AT_@ -50,3 +50,4 @@ Authors
* Rob King - <jking_AT_deadpixi.com>
* Laslo Hunhold - <dev_AT_frign.de> (6.1, git port)
+ * Petr Šabata - <contyk_AT_redhat.com> (bugfixes)
Received on Fri Mar 09 2018 - 19:18:28 CET
This archive was generated by hypermail 2.3.0
: Fri Mar 09 2018 - 19:24:23 CET