Unified tag icon handling while adding support for different icons per monitor.
In general LENGTH(tags) has been replaced with a NUMTAGS macro (defaulting to 9)
and the tags[] array has been replaced with a tagicons[][] array, access to which
is done through a single function tagicon.
This allows one central place where alternative tags, alttagsdecoration, or other
future tags logic is handled. This also gives a consistent display of tags
regardless of the module that presents tags.
Additionally the monitor index has been integrated into dwm for easier access.
This involves always having configuration for floating border, regardless of
whether it is used or not. Also permanently dropping the const expectation
for color configuration in dwm, so that vtcolors and xrdb patches can change
color configuration.
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.