From: Michael Stapelberg Date: Sun, 12 Aug 2012 11:51:47 +0000 (+0200) Subject: set I3_PID atom on the root window X-Git-Tag: 4.3~107 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=394b395455cfcdf49a9ec314650687d4e8d428da;p=i3%2Fi3 set I3_PID atom on the root window --- diff --git a/include/atoms.xmacro b/include/atoms.xmacro index b907f41e..af60b966 100644 --- a/include/atoms.xmacro +++ b/include/atoms.xmacro @@ -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 65b3eb1f..84217a85 100644 --- 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,