Only update bar visibility state, not toggle it
This commit is contained in:
parent
df7894d8fa
commit
2130af8de8
47
src/dwm.c
47
src/dwm.c
|
@ -263,6 +263,7 @@ static void toggleview(const Arg *arg);
|
||||||
static void unfocus(Client *c, int setfocus);
|
static void unfocus(Client *c, int setfocus);
|
||||||
static void unmanage(Client *c, int destroyed);
|
static void unmanage(Client *c, int destroyed);
|
||||||
static void updatebarpos(Monitor *m);
|
static void updatebarpos(Monitor *m);
|
||||||
|
static void updatebar(Monitor *m);
|
||||||
static void updatebars(void);
|
static void updatebars(void);
|
||||||
static void updateclientlist(void);
|
static void updateclientlist(void);
|
||||||
static int updategeom(void);
|
static int updategeom(void);
|
||||||
|
@ -1883,23 +1884,9 @@ tagmon(const Arg *arg)
|
||||||
void
|
void
|
||||||
togglebar(const Arg *arg)
|
togglebar(const Arg *arg)
|
||||||
{
|
{
|
||||||
selmon->show_bar =
|
unit_toggle_show_bar(selmon->pertag->units[selmon->pertag->curtag]);
|
||||||
unit_toggle_show_bar(selmon->pertag->units[selmon->pertag->curtag]);
|
|
||||||
|
|
||||||
updatebarpos(selmon);
|
updatebar(selmon);
|
||||||
resizebarwin(selmon);
|
|
||||||
if (showsystray) {
|
|
||||||
XWindowChanges wc;
|
|
||||||
if (!selmon->show_bar)
|
|
||||||
wc.y = -bh;
|
|
||||||
else if (selmon->show_bar) {
|
|
||||||
wc.y = 0;
|
|
||||||
if (!selmon->topbar)
|
|
||||||
wc.y = selmon->mh - bh;
|
|
||||||
}
|
|
||||||
XConfigureWindow(dpy, systray->win, CWY, &wc);
|
|
||||||
}
|
|
||||||
arrange(selmon);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1972,7 +1959,7 @@ toggleview(const Arg *arg)
|
||||||
if (selmon->show_bar !=
|
if (selmon->show_bar !=
|
||||||
unit_get_show_bar(selmon->pertag->units[selmon->pertag->curtag]))
|
unit_get_show_bar(selmon->pertag->units[selmon->pertag->curtag]))
|
||||||
{
|
{
|
||||||
togglebar(NULL);
|
updatebar(selmon);
|
||||||
}
|
}
|
||||||
|
|
||||||
focus(NULL);
|
focus(NULL);
|
||||||
|
@ -2035,6 +2022,28 @@ unmanage(Client *c, int destroyed)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
updatebar(Monitor *m)
|
||||||
|
{
|
||||||
|
m->show_bar =
|
||||||
|
unit_get_show_bar(selmon->pertag->units[selmon->pertag->curtag]);
|
||||||
|
|
||||||
|
updatebarpos(m);
|
||||||
|
resizebarwin(m);
|
||||||
|
if (showsystray) {
|
||||||
|
XWindowChanges wc;
|
||||||
|
if (!m->show_bar)
|
||||||
|
wc.y = -bh;
|
||||||
|
else if (m->show_bar) {
|
||||||
|
wc.y = 0;
|
||||||
|
if (!m->topbar)
|
||||||
|
wc.y = m->mh - bh;
|
||||||
|
}
|
||||||
|
XConfigureWindow(dpy, systray->win, CWY, &wc);
|
||||||
|
}
|
||||||
|
arrange(m);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
updatebars(void)
|
updatebars(void)
|
||||||
{
|
{
|
||||||
|
@ -2319,7 +2328,7 @@ view(const Arg *arg)
|
||||||
if (selmon->show_bar !=
|
if (selmon->show_bar !=
|
||||||
unit_get_show_bar(selmon->pertag->units[selmon->pertag->curtag]))
|
unit_get_show_bar(selmon->pertag->units[selmon->pertag->curtag]))
|
||||||
{
|
{
|
||||||
togglebar(NULL);
|
updatebar(selmon);
|
||||||
}
|
}
|
||||||
|
|
||||||
focus(NULL);
|
focus(NULL);
|
||||||
|
@ -2364,7 +2373,7 @@ viewrel(const Arg *arg)
|
||||||
if (selmon->show_bar !=
|
if (selmon->show_bar !=
|
||||||
unit_get_show_bar(selmon->pertag->units[selmon->pertag->curtag]))
|
unit_get_show_bar(selmon->pertag->units[selmon->pertag->curtag]))
|
||||||
{
|
{
|
||||||
togglebar(NULL);
|
updatebar(selmon);
|
||||||
}
|
}
|
||||||
|
|
||||||
focus(NULL);
|
focus(NULL);
|
||||||
|
|
Loading…
Reference in New Issue