From 3c1393381a78b7991e5702a3f2082cbe1352c841 Mon Sep 17 00:00:00 2001 From: Bakkeby Date: Mon, 10 Jan 2022 13:40:38 +0100 Subject: [PATCH] Workaround for programs like spotify which do not offer instance or class hints when they initially map, resulting in no rules applying --- dwm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dwm.c b/dwm.c index a96f33c..51f4900 100644 --- a/dwm.c +++ b/dwm.c @@ -63,7 +63,7 @@ enum { SchemeNorm, SchemeSel }; /* color schemes */ enum { NetSupported, NetWMName, NetWMState, NetWMCheck, NetWMFullscreen, NetActiveWindow, NetWMWindowType, NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */ -enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */ +enum { WMClass, WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */ enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, ClkRootWin, ClkLast }; /* clicks */ @@ -1246,6 +1246,8 @@ propertynotify(XEvent *e) } if (ev->atom == netatom[NetWMWindowType]) updatewindowtype(c); + if (ev->atom == wmatom[WMClass]) + applyrules(c); } } @@ -1553,6 +1555,7 @@ setup(void) updategeom(); /* init atoms */ utf8string = XInternAtom(dpy, "UTF8_STRING", False); + wmatom[WMClass] = XInternAtom(dpy, "WM_CLASS", False); wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False); wmatom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False); wmatom[WMState] = XInternAtom(dpy, "WM_STATE", False); -- 2.19.1