bakkeby / dwm-flexipatch

A dwm build with preprocessor directives to decide which patches to include during build time
MIT License
1.17k stars 238 forks source link

awesomebar: window doesn't deselect after hiding it #148

Closed 0xGodspeed closed 3 years ago

0xGodspeed commented 3 years ago

Peek 2021-05-19 21-50 This happens if all windows except 1 are hidden.

bakkeby commented 3 years ago

This appears to be intentional as per the original patch given that the last client is still the selected one even if it is hidden.

+               if (m->sel == c)
+                   scm = SchemeSel;
+               else if (HIDDEN(c))
+                   scm = SchemeHid;
+               else
+                   scm = SchemeNorm;

https://dwm.suckless.org/patches/awesomebar/dwm-awesomebar-20200907-6.2.diff

But I agree that it feels unintuitive.

It is easy enough to flip the if statements so that it is always shown as hidden if it is hidden, but that conflicts with a feature that allows you to cycle through hidden clients using keybindings.

This would be to pass +/- 2 to focusstack instead of +/- 1, there are no default keybindings for this.

    { MODKEY,                       XK_?,          focusstack,             {.i = +2 } },
    { MODKEY,                       XK_?,          focusstack,             {.i = -2 } },

Otherwise you are forced to use the mouse to unhide such windows.

Maybe it would be better to have a SchemeHidSel color scheme for this.

0xGodspeed commented 3 years ago

I tried changing bar_awesome.c

    if (n > 0) {
        remainder = w % n;
        tabw = w / n;
        for (i = 0, c = bar->mon->clients; c; c = c->next, i++) {
            if (!ISVISIBLE(c))
                continue;
            if (bar->mon->sel == c)
                //scm = SchemeSel;
                                scm = SchemeTitleNorm;
            else if (HIDDEN(c))
                scm = SchemeHid;
            else
                scm = SchemeTitleNorm;

but that changes all the windows SchemeTitleNorm. Could you help me with this? I have never used C.

bakkeby commented 3 years ago

I replaced SchemeHid with SchemeHidSel and SchemeHidNorm, it is more clear that way I think.

0xGodspeed commented 3 years ago

What is the best way to update? If I clone the latest repo and compile it again I have to change the config.h everytime even if I save patches.h.

bakkeby commented 3 years ago

If you have cloned it then you can update it with:

$ git pull --rebase

(the --rebase argument is only if you have made any changes on your own, in which case your changes will be added on top of what is being updated)

As for config.def.h and patches.def.h changes you can just do a diff between the default files and your files to see if anything has been added, and if so add the change manually by hand.

meld and diffuse are useful graphical tools to compare two files in a diff view and to copy the lines you want.

0xGodspeed commented 3 years ago

Sorry for the late reply but thanks a lot. Everything works fine now.