Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

togglebar() doesn't work with #define BAR_POS BAR_OFF in config.h #136

Open
thomas3120 opened this issue Mar 29, 2023 · 0 comments
Open

Comments

@thomas3120
Copy link

thomas3120 commented Mar 29, 2023

I like to have the bar disabled by default, but want to be able to switch it back on if necessary (i.e. if I use tags). However, if you configure BAR_POS as BAR_OFF in config.h, the togglebar() function (MOD-s by default) doesn't work, because both bar.pos and bar.lastpos are set to BAR_POS in line 249 of dvtm.c, so togglebar() switches form BAR_OFF to BAR_OFF.

To fix this, I have added a default position (BAR_DEF) for the bar in config.h:

#define BAR_DEF BAR_TOP /* BAR_TOP or BAR_BOTTOM for default values, or BAR_OFF to completely disable the bar */

and updated the togglebar() funtion in dvtm.c:

togglebar(const char *args[]) {
    if (bar.pos == BAR_OFF) {
        if (bar.lastpos == BAR_OFF)
            bar.lastpos = BAR_DEF;
        showbar();
    }
    else
        hidebar();
    bar.autohide = false;
    updatebarpos();
    redraw(NULL);
}

Hope this helps others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant