[wiki] [sites] [dwm][patches][systray] patch for dwm 6.8 (adjusting for the lastest fix of getatomprop) || Aleksei Kozadaev
commit 65946acfd6c946798e9f8a7babc62445fb4b505f
Author: Aleksei Kozadaev <akozadaev at yahoo com>
Date: Mon Feb 23 13:09:03 2026 +0000
[dwm][patches][systray] patch for dwm 6.8 (adjusting for the lastest fix of getatomprop)
diff --git a/dwm.suckless.org/patches/systray/dwm-systray-6.8.diff b/dwm.suckless.org/patches/systray/dwm-systray-6.8.diff
index 1a5ec81e..2831d992 100644
--- a/dwm.suckless.org/patches/systray/dwm-systray-6.8.diff
+++ b/dwm.suckless.org/patches/systray/dwm-systray-6.8.diff
_AT_@ -26,7 +26,7 @@ index 81c3fc0..364b394 100644
{ ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
{ ClkClientWin, MODKEY, Button1, movemouse, {0} },
diff --git a/dwm.c b/dwm.c
-index fc4232e..1d04490 100644
+index 0a67103..fc4dfc4 100644
--- a/dwm.c
+++ b/dwm.c
_AT_@ -56,12 +56,27 @@
_AT_@ -57,20 +57,19 @@ index fc4232e..1d04490 100644
enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */
enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle,
ClkClientWin, ClkRootWin, ClkLast }; /* clicks */
-_AT_@ -140,6 +155,12 @@ typedef struct {
+_AT_@ -140,6 +155,11 @@ typedef struct {
int monitor;
} Rule;
-+typedef struct Systray Systray;
-+struct Systray {
++typedef struct {
+ Window win;
+ Client *icons;
-+};
++} Systray;
+
/* function declarations */
static void applyrules(Client *c);
static int applysizehints(Client *c, int *x, int *y, int *w, int *h, int interact);
-_AT_@ -171,6 +192,7 @@ static void focusstack(const Arg *arg);
+_AT_@ -171,6 +191,7 @@ static void focusstack(const Arg *arg);
static Atom getatomprop(Client *c, Atom prop);
static int getrootptr(int *x, int *y);
static long getstate(Window w);
_AT_@ -78,7 +77,7 @@ index fc4232e..1d04490 100644
static int gettextprop(Window w, Atom atom, char *text, unsigned int size);
static void grabbuttons(Client *c, int focused);
static void grabkeys(void);
-_AT_@ -188,13 +210,16 @@ static void pop(Client *c);
+_AT_@ -188,13 +209,16 @@ static void pop(Client *c);
static void propertynotify(XEvent *e);
static void quit(const Arg *arg);
static Monitor *recttomon(int x, int y, int w, int h);
_AT_@ -96,7 +95,7 @@ index fc4232e..1d04490 100644
static void sendmon(Client *c, Monitor *m);
static void setclientstate(Client *c, long state);
static void setfocus(Client *c);
-_AT_@ -205,6 +230,7 @@ static void setup(void);
+_AT_@ -205,6 +229,7 @@ static void setup(void);
static void seturgent(Client *c, int urg);
static void showhide(Client *c);
static void spawn(const Arg *arg);
_AT_@ -104,7 +103,7 @@ index fc4232e..1d04490 100644
static void tag(const Arg *arg);
static void tagmon(const Arg *arg);
static void tile(Monitor *m);
-_AT_@ -222,18 +248,23 @@ static int updategeom(void);
+_AT_@ -222,18 +247,23 @@ static int updategeom(void);
static void updatenumlockmask(void);
static void updatesizehints(Client *c);
static void updatestatus(void);
_AT_@ -128,7 +127,7 @@ index fc4232e..1d04490 100644
static const char broken[] = "broken";
static char stext[256];
static int screen;
-_AT_@ -256,9 +287,10 @@ static void (*handler[LASTEvent]) (XEvent *) = {
+_AT_@ -256,9 +286,10 @@ static void (*handler[LASTEvent]) (XEvent *) = {
[MapRequest] = maprequest,
[MotionNotify] = motionnotify,
[PropertyNotify] = propertynotify,
_AT_@ -140,7 +139,7 @@ index fc4232e..1d04490 100644
static int running = 1;
static Cur *cursor[CurLast];
static Clr **scheme;
-_AT_@ -440,7 +472,7 @@ buttonpress(XEvent *e)
+_AT_@ -440,7 +471,7 @@ buttonpress(XEvent *e)
arg.ui = 1 << i;
} else if (ev->x < x + TEXTW(selmon->ltsymbol))
click = ClkLtSymbol;
_AT_@ -149,7 +148,7 @@ index fc4232e..1d04490 100644
click = ClkStatusText;
else
click = ClkWinTitle;
-_AT_@ -483,6 +515,13 @@ cleanup(void)
+_AT_@ -483,6 +514,13 @@ cleanup(void)
XUngrabKey(dpy, AnyKey, AnyModifier, root);
while (mons)
cleanupmon(mons);
_AT_@ -163,7 +162,7 @@ index fc4232e..1d04490 100644
for (i = 0; i < CurLast; i++)
drw_cur_free(drw, cursor[i]);
for (i = 0; i < LENGTH(colors); i++)
-_AT_@ -514,9 +553,58 @@ cleanupmon(Monitor *mon)
+_AT_@ -514,9 +552,58 @@ cleanupmon(Monitor *mon)
void
clientmessage(XEvent *e)
{
_AT_@ -222,7 +221,7 @@ index fc4232e..1d04490 100644
if (!c)
return;
if (cme->message_type == netatom[NetWMState]) {
-_AT_@ -569,7 +657,7 @@ configurenotify(XEvent *e)
+_AT_@ -569,7 +656,7 @@ configurenotify(XEvent *e)
for (c = m->clients; c; c = c->next)
if (c->isfullscreen)
resizeclient(c, m->mx, m->my, m->mw, m->mh);
_AT_@ -231,7 +230,7 @@ index fc4232e..1d04490 100644
}
focus(NULL);
arrange(NULL);
-_AT_@ -654,6 +742,11 @@ destroynotify(XEvent *e)
+_AT_@ -654,6 +741,11 @@ destroynotify(XEvent *e)
if ((c = wintoclient(ev->window)))
unmanage(c, 1);
_AT_@ -243,7 +242,7 @@ index fc4232e..1d04490 100644
}
void
-_AT_@ -697,7 +790,7 @@ dirtomon(int dir)
+_AT_@ -697,7 +789,7 @@ dirtomon(int dir)
void
drawbar(Monitor *m)
{
_AT_@ -252,7 +251,7 @@ index fc4232e..1d04490 100644
int boxs = drw->fonts->h / 9;
int boxw = drw->fonts->h / 6 + 2;
unsigned int i, occ = 0, urg = 0;
-_AT_@ -706,13 +799,17 @@ drawbar(Monitor *m)
+_AT_@ -706,13 +798,17 @@ drawbar(Monitor *m)
if (!m->showbar)
return;
_AT_@ -272,7 +271,7 @@ index fc4232e..1d04490 100644
for (c = m->clients; c; c = c->next) {
occ |= c->tags;
if (c->isurgent)
-_AT_@ -733,7 +830,7 @@ drawbar(Monitor *m)
+_AT_@ -733,7 +829,7 @@ drawbar(Monitor *m)
drw_setscheme(drw, scheme[SchemeNorm]);
x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
_AT_@ -281,7 +280,7 @@ index fc4232e..1d04490 100644
if (m->sel) {
drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0);
-_AT_@ -744,7 +841,7 @@ drawbar(Monitor *m)
+_AT_@ -744,7 +840,7 @@ drawbar(Monitor *m)
drw_rect(drw, x, 0, w, bh, 1, 1);
}
}
_AT_@ -290,7 +289,7 @@ index fc4232e..1d04490 100644
}
void
-_AT_@ -781,8 +878,11 @@ expose(XEvent *e)
+_AT_@ -781,8 +877,11 @@ expose(XEvent *e)
Monitor *m;
XExposeEvent *ev = &e->xexpose;
_AT_@ -303,7 +302,7 @@ index fc4232e..1d04490 100644
}
void
-_AT_@ -868,15 +968,32 @@ getatomprop(Client *c, Atom prop)
+_AT_@ -868,15 +967,33 @@ getatomprop(Client *c, Atom prop)
unsigned char *p = NULL;
Atom da, atom = None;
_AT_@ -315,12 +314,11 @@ index fc4232e..1d04490 100644
+ req = xatom[XembedInfo];
+
+ if (XGetWindowProperty(dpy, c->win, prop, 0L, sizeof atom, False, req,
- &da, &di, &nitems, &dl, &p) == Success && p) {
-- if (nitems > 0)
-- atom = *(Atom *)p;
-+ atom = *(Atom *)p;
-+ if (da == xatom[XembedInfo] && nitems == 2)
-+ atom = ((Atom *)p)[1];
+ &da, &format, &nitems, &dl, &p) == Success && p) {
+ if (nitems > 0 && format == 32)
+ atom = *(long *)p;
++ if (da == xatom[XembedInfo] && nitems == 2 && format == 32)
++ atom = ((long *)p)[1];
XFree(p);
}
return atom;
Received on Mon Feb 23 2026 - 14:09:12 CET
This archive was generated by hypermail 2.3.0
: Mon Feb 23 2026 - 14:12:46 CET