systray: systray was not fully transparent when using systray spacing

This commit is contained in:
bakkeby
2020-07-20 07:31:23 +02:00
parent 990558bb34
commit 68e146f84a

View File

@@ -77,14 +77,15 @@ updatesystray(void)
wa.override_redirect = True; wa.override_redirect = True;
wa.event_mask = ButtonPressMask|ExposureMask; wa.event_mask = ButtonPressMask|ExposureMask;
wa.background_pixel = scheme[SchemeNorm][ColBg].pixel;
wa.border_pixel = 0; wa.border_pixel = 0;
#if ALPHA_PATCH #if ALPHA_PATCH
wa.background_pixel = 0;
wa.colormap = cmap; wa.colormap = cmap;
systray->win = XCreateWindow(dpy, root, x - xpad, m->by + ypad, 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
wa.background_pixel = scheme[SchemeNorm][ColBg].pixel;
systray->win = XCreateSimpleWindow(dpy, root, x - xpad, m->by + ypad, w, bh, 0, 0, scheme[SchemeNorm][ColBg].pixel); systray->win = XCreateSimpleWindow(dpy, root, x - xpad, m->by + ypad, w, bh, 0, 0, scheme[SchemeNorm][ColBg].pixel);
XChangeWindowAttributes(dpy, systray->win, CWOverrideRedirect|CWBackPixel|CWBorderPixel|CWEventMask, &wa); XChangeWindowAttributes(dpy, systray->win, CWOverrideRedirect|CWBackPixel|CWBorderPixel|CWEventMask, &wa);
#endif // ALPHA_PATCH #endif // ALPHA_PATCH
@@ -114,7 +115,11 @@ updatesystray(void)
drw_setscheme(drw, scheme[SchemeNorm]); drw_setscheme(drw, scheme[SchemeNorm]);
for (w = 0, i = systray->icons; i; i = i->next) { for (w = 0, i = systray->icons; i; i = i->next) {
/* make sure the background color stays the same */ /* make sure the background color stays the same */
#if ALPHA_PATCH
wa.background_pixel = 0;
#else
wa.background_pixel = scheme[SchemeNorm][ColBg].pixel; wa.background_pixel = scheme[SchemeNorm][ColBg].pixel;
#endif // ALPHA_PATCH
XChangeWindowAttributes(dpy, i->win, CWBackPixel, &wa); XChangeWindowAttributes(dpy, i->win, CWBackPixel, &wa);
XMapRaised(dpy, i->win); XMapRaised(dpy, i->win);
w += systrayspacing; w += systrayspacing;