diff --git a/dwm.c b/dwm.c index f6ffb77..e58d758 100644 --- a/dwm.c +++ b/dwm.c @@ -2160,7 +2160,7 @@ maprequest(XEvent *e) #if BAR_SYSTRAY_PATCH Client *i; - if (showsystray && (i = wintosystrayicon(ev->window))) { + if (showsystray && systray && (i = wintosystrayicon(ev->window))) { sendevent(i->win, netatom[Xembed], StructureNotifyMask, CurrentTime, XEMBED_WINDOW_ACTIVATE, 0, systray->win, XEMBED_EMBEDDED_VERSION); drawbarwin(systray->bar); } diff --git a/patch/bar_systray.c b/patch/bar_systray.c index dc267fb..5ca78f7 100644 --- a/patch/bar_systray.c +++ b/patch/bar_systray.c @@ -152,7 +152,7 @@ updatesystrayiconstate(Client *i, XPropertyEvent *ev) long flags; int code = 0; - if (!showsystray || !i || ev->atom != xatom[XembedInfo] || + if (!showsystray || !systray || !i || ev->atom != xatom[XembedInfo] || !(flags = getatomprop(i, xatom[XembedInfo]))) return;