setPixmapProperty() called XKillClient(dpy, old_pixmap) to free the
previous background pixmap stored in _XROOTPMAP_ID. The pixmap was
created by duplicatePixmap() via a short-lived second X connection
that used XSetCloseDownMode(RetainPermanent). After that connection
closed, the X server eventually recycled its client ID for a new
connection. If wmsetbg's own 'dpy' connection received that recycled
ID, XKillClient() would kill wmsetbg itself, causing the fatal error:
X connection to :0 broken (explicit kill or server shutdown).
Fix by switching from RetainPermanent to RetainTemporary in
duplicatePixmap(). With RetainTemporary, background pixmaps are kept
alive for the lifetime of the X session and freed automatically at
logout — no explicit XKillClient() is needed.
Remove the now-dead XKillClient() block from setPixmapProperty():
- dummyErrorHandler() was only used to suppress its X errors; remove.
- The mode variable toggled PropModeReplace/PropModeAppend based on
whether an old pixmap was present; since we always want to replace,
use PropModeReplace unconditionally.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
XGetWindowProperty() allocates a buffer and returns it via the 'data'
pointer; the caller is responsible for freeing it with XFree() when
done. setPixmapProperty() read the old _XROOTPMAP_ID value but never
freed the returned buffer, leaking memory on every background change.
Add the missing XFree(data) call.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Some applications running in my machine are only background
windows, e.g.: screenlets showing CPU usage.
In current wmaker version all these applications pollute my
switchpanel, so I wrote this patch (thanks Carlos for the helping me).
It includes an additional advanced option for windows "Do not
include in switchpanel" which, if set, allows applications to
not appear in the switchpanel.
Signed-off-by: Haroldo Santos <haroldo.santos@gmail.com>