summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2020-09-12 14:21:51 +0200
committerbakkeby <[email protected]>2020-09-12 14:21:51 +0200
commit819d06c5c9de496a41026e6077661c7b91877e96 (patch)
tree952e0a3201be532a0da834f10aedcdc413e78e09
parent7b477bc7dba3c29c7393e4f37963ee9f62c9c817 (diff)
downloaddwm-flexipatch-819d06c5c9de496a41026e6077661c7b91877e96.tar.gz
dwm-flexipatch-819d06c5c9de496a41026e6077661c7b91877e96.zip
swallow: arrange monitor if window is not swallowed
-rw-r--r--dwm.c4
-rw-r--r--patch/swallow.c8
-rw-r--r--patch/swallow.h2
3 files changed, 7 insertions, 7 deletions
diff --git a/dwm.c b/dwm.c
index 7d421d5..7f76a48 100644
--- a/dwm.c
+++ b/dwm.c
@@ -2214,9 +2214,7 @@ manage(Window w, XWindowAttributes *wa)
XMapWindow(dpy, c->win);
#endif // BAR_WINTITLEACTIONS_PATCH
#if SWALLOW_PATCH
- if (term)
- swallow(term, c);
- else
+ if (!(term && swallow(term, c)))
arrange(c->mon);
#else
arrange(c->mon);
diff --git a/patch/swallow.c b/patch/swallow.c
index 397c0e8..744eba3 100644
--- a/patch/swallow.c
+++ b/patch/swallow.c
@@ -8,15 +8,15 @@
static int scanner;
static xcb_connection_t *xcon;
-void
+int
swallow(Client *p, Client *c)
{
Client *s;
if (c->noswallow > 0 || c->isterminal)
- return;
+ return 0;
if (c->noswallow < 0 && !swallowfloating && c->isfloating)
- return;
+ return 0;
detach(c);
detachstack(c);
@@ -40,6 +40,8 @@ swallow(Client *p, Client *c)
arrange(p->mon);
configure(p);
updateclientlist();
+
+ return 1;
}
void
diff --git a/patch/swallow.h b/patch/swallow.h
index 98ae7fb..d44a7ea 100644
--- a/patch/swallow.h
+++ b/patch/swallow.h
@@ -1,6 +1,6 @@
static pid_t getparentprocess(pid_t p);
static int isdescprocess(pid_t p, pid_t c);
-static void swallow(Client *p, Client *c);
+static int swallow(Client *p, Client *c);
static Client *swallowingclient(Window w);
static Client *termforwin(const Client *c);
static void unswallow(Client *c);