Skip to content

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

Description

@thomas3120

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions