]> git.sur5r.net Git - i3/i3/commitdiff
set I3_PID atom on the root window
authorMichael Stapelberg <michael@stapelberg.de>
Sun, 12 Aug 2012 11:51:47 +0000 (13:51 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Sun, 12 Aug 2012 11:51:47 +0000 (13:51 +0200)
include/atoms.xmacro
src/x.c

index b907f41e9ca2f67f60a87e794a72c02da0acfd9a..af60b9660453d3eb93c58e66f31d691702420c09 100644 (file)
@@ -27,3 +27,4 @@ xmacro(I3_SOCKET_PATH)
 xmacro(I3_CONFIG_PATH)
 xmacro(I3_SYNC)
 xmacro(I3_SHMLOG_PATH)
+xmacro(I3_PID)
diff --git a/src/x.c b/src/x.c
index 65b3eb1f0ff07a0ab71138c6b2d88eb3748f136e..84217a85f1101a6d8659ed77d6674ebbe2c5c1db 100644 (file)
--- a/src/x.c
+++ b/src/x.c
@@ -1030,9 +1030,11 @@ void x_set_name(Con *con, const char *name) {
  *
  */
 void x_set_i3_atoms(void) {
+    pid_t pid = getpid();
     xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root, A_I3_SOCKET_PATH, A_UTF8_STRING, 8,
                         (current_socketpath == NULL ? 0 : strlen(current_socketpath)),
                         current_socketpath);
+    xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root, A_I3_PID, XCB_ATOM_CARDINAL, 32, 1, &pid);
     xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root, A_I3_CONFIG_PATH, A_UTF8_STRING, 8,
                         strlen(current_configpath), current_configpath);
     xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root, A_I3_SHMLOG_PATH, A_UTF8_STRING, 8,