From 19e1abe590e3fde3244cac544472741fccc881cd Mon Sep 17 00:00:00 2001 From: Gunther Klessinger Date: Sun, 6 Jun 2021 17:56:06 +0200 Subject: [PATCH] Supporting xfce4-panel in dwm We basically treat the panel as special window which - never has borders - always has y=0 - is never shown as active window in the indicators - is shown on all tags Which window? "xfce4-panel" - hardcoded by window name in dwm.c. => Should work for other panels as well, if you adapt. --- config.def.h | 1 + dwm.c | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/config.def.h b/config.def.h index 1c0b587..b772bd9 100644 --- a/config.def.h +++ b/config.def.h @@ -29,6 +29,7 @@ static const Rule rules[] = { /* class instance title tags mask isfloating monitor */ { "Gimp", NULL, NULL, 0, 1, -1 }, { "Firefox", NULL, NULL, 1 << 8, 0, -1 }, + { "Xfce4-panel", NULL, NULL, (1 << 9)-1, 0, -1 }, }; /* layout(s) */ diff --git a/dwm.c b/dwm.c index b0b3466..5fafd62 100644 --- a/dwm.c +++ b/dwm.c @@ -710,6 +710,8 @@ drawbar(Monitor *m) } for (c = m->clients; c; c = c->next) { + // prevent showing the panel as active application: + if (!strcmp(c->name, "xfce4-panel")) continue; occ |= c->tags; if (c->isurgent) urg |= c->tags; @@ -1049,6 +1051,9 @@ manage(Window w, XWindowAttributes *wa) c->y = MAX(c->y, ((c->mon->by == c->mon->my) && (c->x + (c->w / 2) >= c->mon->wx) && (c->x + (c->w / 2) < c->mon->wx + c->mon->ww)) ? bh : c->mon->my); c->bw = borderpx; + // no border - even when active + // do not match on y, does not have it yet possibly: + if (!strcmp(c->name, "xfce4-panel")) c->bw = c->oldbw = 0; wc.border_width = c->bw; XConfigureWindow(dpy, w, CWBorderWidth, &wc); @@ -1283,6 +1288,9 @@ resizeclient(Client *c, int x, int y, int w, int h) c->oldw = c->w; c->w = wc.width = w; c->oldh = c->h; c->h = wc.height = h; wc.border_width = c->bw; + if (!strcmp(c->name, "xfce4-panel")) { + c->y = c->oldy = c->bw = wc.y = wc.border_width = 0; + } XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); configure(c); XSync(dpy, False); @@ -1991,7 +1999,7 @@ void updatestatus(void) { if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext))) - strcpy(stext, "dwm-"VERSION); + strcpy(stext, " "); // no shining of dwm version thru altpanel, when transparent drawbar(selmon); } -- 2.31.1