summaryrefslogtreecommitdiffhomepage
path: root/patch
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2020-07-05 13:20:28 +0200
committerbakkeby <[email protected]>2020-07-05 13:20:28 +0200
commitf58c699dbb40293645f646f5488de81d4eb3d517 (patch)
treec7d2ecb5db7091a4c1dc9842c05e0e3bcbbc060e /patch
parent9fcb63164da434a44d118d8c10e2c4eb4c2b969b (diff)
downloaddwm-flexipatch-f58c699dbb40293645f646f5488de81d4eb3d517.tar.gz
dwm-flexipatch-f58c699dbb40293645f646f5488de81d4eb3d517.zip
Fix for dwm randomly crashing when the first systray application starts
The crash error was: dwm: fatal error: request code=12, error code=11 X Error of failed request: BadAlloc (insufficient resources for operation) Major opcode of failed request: 12 (X_ConfigureWindow) Serial number of failed request: 3333 Current serial number in output stream: 3338 This was backtracked to function updatesystray where XConfigureWindow was called with large negative X positions (e.g. -836585). The large number coming from the width of the systray icon. w += i->w; The systray icon width is set through the updatesystrayicongeom function and this is called by resizerequest, clientmessage and propertynotify. The height and width would appear to come from the X window attributes and sometimes have random values (e.g. height 32708 and width 1369918222). updatesystrayicongeom restricts the height of the icon to that of the bar, but did not have any restictions on the icon width. This fix limits the icon width to that of the bar height if it is greater than twice the bar height, leaving room for systray icons that are slightly wider than they are tall.
Diffstat (limited to 'patch')
-rw-r--r--patch/systray.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/patch/systray.c b/patch/systray.c
index 107bcbc..0ca2f86 100644
--- a/patch/systray.c
+++ b/patch/systray.c
@@ -161,6 +161,8 @@ updatesystrayicongeom(Client *i, int w, int h)
i->w = (int) ((float)bh * ((float)i->w / (float)i->h));
i->h = bh;
}
+ if (i->w > 2*bh)
+ i->w = bh;
}
}