This commit is contained in:
Zoe Roux
2022-09-07 04:59:24 +02:00
parent c32d53ad76
commit 1996a3be2a
2 changed files with 13 additions and 3 deletions

3
dwm.c
View File

@@ -107,7 +107,7 @@ enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
enum { SchemeNorm, SchemeSel, SchemeUrg }; /* color schemes */
enum { NetSupported, NetWMName, NetWMState, NetWMCheck,
NetWMFullscreen, NetActiveWindow, NetWMWindowType,
NetSystemTray, NetSystemTrayOP, NetSystemTrayOrientation,
NetSystemTray, NetSystemTrayOP, NetSystemTrayOrientation, NetWmStateSkipTaskbar,
NetSystemTrayVisual, NetWMWindowTypeDock, NetSystemTrayOrientationHorz,
NetDesktopNames, NetDesktopViewport, NetNumberOfDesktops, NetCurrentDesktop,
NetClientListStacking,
@@ -2525,6 +2525,7 @@ setup(void)
netatom[NetSystemTrayOrientation] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_ORIENTATION", False);
netatom[NetSystemTrayOrientationHorz] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_ORIENTATION_HORZ", False);
netatom[NetSystemTrayVisual] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_VISUAL", False);
netatom[NetWmStateSkipTaskbar] = XInternAtom(dpy, "_NET_WM_STATE_SKIP_TASKBAR", False);
netatom[NetWMWindowTypeDock] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DOCK", False);
xatom[Manager] = XInternAtom(dpy, "MANAGER", False);
xatom[Xembed] = XInternAtom(dpy, "_XEMBED", False);

View File

@@ -6,10 +6,16 @@ width_systray(Bar *bar, BarWidthArg *a)
{
unsigned int w = 0;
Client *i;
Atom flags;
if (!systray)
return 1;
if (showsystray)
for (i = systray->icons; i; w += i->w + systrayspacing, i = i->next);
if (showsystray) {
for (i = systray->icons; i; i = i->next) {
if (!(flags = getatomprop(i, netatom[NetWmStateSkipTaskbar])))
w += i->w + systrayspacing;
}
}
return w ? w + lrpad - systrayspacing : 0;
}
@@ -25,6 +31,7 @@ draw_systray(Bar *bar, BarDrawArg *a)
XSetWindowAttributes wa;
Client *i;
unsigned int w;
Atom flags;
if (!systray) {
/* init systray */
@@ -72,6 +79,8 @@ draw_systray(Bar *bar, BarDrawArg *a)
drw_setscheme(drw, scheme[SchemeNorm]);
for (w = 0, i = systray->icons; i; i = i->next) {
if ((flags = getatomprop(i, netatom[NetWmStateSkipTaskbar])))
continue;
#if BAR_ALPHA_PATCH
wa.background_pixel = 0;
#else