]> git.armaanb.net Git - dwm.git/commitdiff
Do not allow focus to drift from fullscreen client via focusstack()
authorChris Down <chris@chrisdown.name>
Thu, 2 Jul 2020 19:18:30 +0000 (20:18 +0100)
committerHiltjo Posthuma <hiltjo@codemadness.org>
Mon, 29 Mar 2021 17:16:27 +0000 (19:16 +0200)
It generally doesn't make much sense to allow focusstack() to navigate
away from the selected fullscreen client, as you can't even see which
client you're selecting behind it.

I have had this up for a while on the wiki as a separate patch[0], but
it seems reasonable to avoid this behaviour in dwm mainline, since I'm
struggling to think of any reason to navigate away from a fullscreen
client other than a mistake.

0: https://dwm.suckless.org/patches/alwaysfullscreen/

dwm.c

diff --git a/dwm.c b/dwm.c
index 664c527f21f852967ba41739fda440429277df84..b0b3466881b84872a6b261cc1ed42afed08ac3bd 100644 (file)
--- a/dwm.c
+++ b/dwm.c
@@ -835,7 +835,7 @@ focusstack(const Arg *arg)
 {
        Client *c = NULL, *i;
 
-       if (!selmon->sel)
+       if (!selmon->sel || selmon->sel->isfullscreen)
                return;
        if (arg->i > 0) {
                for (c = selmon->sel->next; c && !ISVISIBLE(c); c = c->next);