fix: systray icon off when switching barpos

This commit is contained in:
speediegq 2022-10-28 23:30:52 +02:00
parent 89c955de3b
commit 0b9551fffe

View file

@ -5834,9 +5834,9 @@ togglebarpos(const Arg *arg)
return;
selmon->barposition = !selmon->barposition;
updatebarpos(selmon);
//updatebarpos(selmon);
#if USESYSTRAY
resizebarwin(selmon);
//resizebarwin(selmon);
if (!selmon->hidesystray) {
XWindowChanges wc;
wc.y = 0;
@ -5844,6 +5844,8 @@ togglebarpos(const Arg *arg)
wc.y = selmon->mh - bh;
XConfigureWindow(dpy, systray->win, CWY, &wc);
}
updatebarpos(selmon);
resizebarwin(selmon);
#else
if (selmon->barposition) {
XMoveResizeWindow(dpy, selmon->barwin, selmon->wx + sp, selmon->by + vp, selmon->ww - 2 * sp, selmon->bh);
@ -6942,7 +6944,13 @@ updatesystray(void)
Client *i;
Monitor *m = systraytomon(NULL);
unsigned int x = m->mx + m->mw - sp;
unsigned int y = m->by + vp;
unsigned int y = m->by;
if (!selmon->barposition)
y -= vp;
else
y += vp;
unsigned int sw = TEXTW(stext) - lrpad + systrayspacing;
unsigned int w = 1;