bakkeby / patches

Collection of patches for dwm, st and dmenu
286 stars 30 forks source link

Fullscreen swallow issue #36

Closed ghost closed 3 years ago

ghost commented 3 years ago

When swallowing in a fullscreen terminal window, the new client spawns in floating mode (with messed up geometry). This has been fixed in Luke's build https://github.com/LukeSmithxyz/dwm/commit/7d735656f7fabe0107e36dc672b61a37fc8930c4.

bakkeby commented 3 years ago

That commit has nothing to do with this though, it has to do with retaining the border width of the terminal. The change is also for this patch: https://dwm.suckless.org/patches/swallow/

That the new window has its own size hints is expected behaviour with this version of the swallow patch.

I presume your expectation here is that the new window should also be in fullscreen, in which case I might propose something like this:

diff --git a/dwm.c b/dwm.c
index 547a7d4..d55c2f5 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1349,7 +1349,7 @@ replaceclient(Client *old, Client *new)

        XMoveWindow(dpy, old->win, WIDTH(old) * -2, old->y);

-       if (ISVISIBLE(new)) {
+       if (ISVISIBLE(new) && !new->isfullscreen) {
                if (new->isfloating)
                        resize(new, old->x, old->y, new->w - 2*new->bw, new->h - 2*new->bw, 0);
                else
@@ -1752,6 +1752,9 @@ swallow(Client *t, Client *c)
        if (!swallowfloating && c->isfloating)
                return 0;

+       if (t->isfullscreen)
+               setfullscreen(c, 1);
+
        replaceclient(t, c);
        c->ignorecfgreqpos = 1;
        c->swallowing = t;
ghost commented 3 years ago

I presume your expectation here is that the new window should also be in fullscreen

Yes, that's what I wanted. Your above suggestion works great. Thanks!