From 39fde74dfd48056094c4eddacd7baac9194e5c1e Mon Sep 17 00:00:00 2001 From: bakkeby Date: Fri, 17 Jun 2022 16:58:47 +0200 Subject: [PATCH] systray: allow systray icons to survive a restart by handing systray icons over to the root window before destroying the systray window --- dwm.c | 3 --- patch/bar_systray.c | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/dwm.c b/dwm.c index 6b1ce9c..02dea6b 100644 --- a/dwm.c +++ b/dwm.c @@ -1234,9 +1234,6 @@ cleanup(void) removesystrayicon(systray->icons); if (systray->win) { XUnmapWindow(dpy, systray->win); - #if RESTARTSIG_PATCH - if (!restart) - #endif // RESTARTSIG_PATCH XDestroyWindow(dpy, systray->win); } free(systray); diff --git a/patch/bar_systray.c b/patch/bar_systray.c index 36d569a..158dfa3 100644 --- a/patch/bar_systray.c +++ b/patch/bar_systray.c @@ -111,6 +111,7 @@ removesystrayicon(Client *i) for (ii = &systray->icons; *ii && *ii != i; ii = &(*ii)->next); if (ii) *ii = i->next; + XReparentWindow(dpy, i->win, root, 0, 0); free(i); drawbarwin(systray->bar); }