]> git.sur5r.net Git - i3/i3/commitdiff
shmlog: remote atom when disabled 3059/head
authorMichael Stapelberg <michael@stapelberg.de>
Sun, 26 Nov 2017 17:07:13 +0000 (18:07 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Sun, 26 Nov 2017 17:07:13 +0000 (18:07 +0100)
src/x.c

diff --git a/src/x.c b/src/x.c
index 09a604931926aa4915d8e388177f849bfdbe16c5..7829079bb0363f8514e5b1abe6513434c0db809a 100644 (file)
--- a/src/x.c
+++ b/src/x.c
@@ -1227,9 +1227,13 @@ void x_set_name(Con *con, const char *name) {
  *
  */
 void update_shmlog_atom() {
-    xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root,
-                        A_I3_SHMLOG_PATH, A_UTF8_STRING, 8,
-                        strlen(shmlogname), shmlogname);
+    if (*shmlogname == '\0') {
+        xcb_delete_property(conn, root, A_I3_SHMLOG_PATH);
+    } else {
+        xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root,
+                            A_I3_SHMLOG_PATH, A_UTF8_STRING, 8,
+                            strlen(shmlogname), shmlogname);
+    }
 }
 
 /*