Hi,
This small series fixes a crash in wmsetbg that shows up when setting
a background from the menu or command line:
X connection to :0 broken (explicit kill or server shutdown).
The root cause is in setPixmapProperty(): it called XKillClient() to
free the previous background pixmap stored in _XROOTPMAP_ID. The
pixmap was created via a short-lived second X connection using
RetainPermanent. The X server reuses client IDs after connections
close; if wmsetbg's own connection later received the same recycled ID
as the stored pixmap, XKillClient() would kill its own connection.
The fix is to switch to RetainTemporary: background pixmaps live for
the duration of the X session and are freed automatically at logout,
so no explicit XKillClient() is required.
Tested on a dual-monitor setup (1920x1200 + 2560x1440, Xinerama
active) where the crash was 100% reproducible before this series.
Haroldo Santos (2):
wmsetbg: fix memory leak of XGetWindowProperty data in setPixmapProperty
wmsetbg: fix "X connection broken" crash when setting background
util/wmsetbg.c | 2 ++
1 file changed, 2 insertions(+)
util/wmsetbg.c | 39 ++++++++++++++++-----------------------
1 file changed, 16 insertions(+), 23 deletions(-)