Fix for systray flickering ref. #9

This commit is contained in:
bakkeby 2020-02-09 15:17:05 +01:00
parent ed20fd9c61
commit 8cb609fa1e

View File

@ -62,7 +62,11 @@ updatesystray(void)
Client *i; Client *i;
Monitor *m = systraytomon(NULL); Monitor *m = systraytomon(NULL);
unsigned int x = m->mx + m->mw; unsigned int x = m->mx + m->mw;
unsigned int w = 1; unsigned int w = 1, xpad = 0, ypad = 0;
#if BARPADDING_PATCH
xpad = sp;
ypad = vp;
#endif // BARPADDING_PATCH
if (!showsystray) if (!showsystray)
return; return;
@ -79,11 +83,11 @@ updatesystray(void)
.colormap = cmap, .colormap = cmap,
.event_mask = ButtonPressMask|ExposureMask .event_mask = ButtonPressMask|ExposureMask
}; };
systray->win = XCreateWindow(dpy, root, x, m->by, w, bh, 0, depth, systray->win = XCreateWindow(dpy, root, x - xpad, m->by + ypad, w, bh, 0, depth,
InputOutput, visual, InputOutput, visual,
CWOverrideRedirect|CWBackPixel|CWBorderPixel|CWColormap|CWEventMask, &wa); CWOverrideRedirect|CWBackPixel|CWBorderPixel|CWColormap|CWEventMask, &wa);
#else #else
systray->win = XCreateSimpleWindow(dpy, root, x, m->by, w, bh, 0, 0, scheme[SchemeSel][ColBg].pixel); systray->win = XCreateSimpleWindow(dpy, root, x - xpad, m->by + ypad, w, bh, 0, 0, scheme[SchemeSel][ColBg].pixel);
#endif // ALPHA_PATCH #endif // ALPHA_PATCH
XSelectInput(dpy, systray->win, SubstructureNotifyMask); XSelectInput(dpy, systray->win, SubstructureNotifyMask);
XChangeProperty(dpy, systray->win, netatom[NetSystemTrayOrientation], XA_CARDINAL, 32, XChangeProperty(dpy, systray->win, netatom[NetSystemTrayOrientation], XA_CARDINAL, 32,
@ -121,14 +125,9 @@ updatesystray(void)
} }
w = w ? w + systrayspacing : 1; w = w ? w + systrayspacing : 1;
x -= w; x -= w;
XMoveResizeWindow(dpy, systray->win, x, m->by, w, bh); XMoveResizeWindow(dpy, systray->win, x - xpad, m->by + ypad, w, bh);
#if BARPADDING_PATCH wc.x = x - xpad;
wc.x = x - sp; wc.y = m->by + ypad;
wc.y = m->by + vp;
#else
wc.x = x;
wc.y = m->by;
#endif // BARPADDING_PATCH
wc.width = w; wc.width = w;
wc.height = bh; wc.height = bh;
wc.stack_mode = Above; wc.sibling = m->barwin; wc.stack_mode = Above; wc.sibling = m->barwin;