]> git.sur5r.net Git - i3/i3/blobdiff - src/nc.c
correctly update/display window title/class
[i3/i3] / src / nc.c
index f5843d55dd581dfb3e641a592aa90ada067acbdb..7b2b126ac6c507ec7a066c6eb8d7f8f54207149e 100644 (file)
--- a/src/nc.c
+++ b/src/nc.c
@@ -14,6 +14,7 @@ char **start_argv;
 
 xcb_connection_t *conn;
 xcb_event_handlers_t evenths;
+xcb_property_handlers_t prophs;
 xcb_atom_t atoms[NUM_ATOMS];
 
 xcb_window_t root;
@@ -295,8 +296,11 @@ int main(int argc, char *argv[]) {
     REQUEST_ATOM(_NET_ACTIVE_WINDOW);
     REQUEST_ATOM(_NET_WORKAREA);
 
+    memset(&evenths, 0, sizeof(xcb_event_handlers_t));
+    memset(&prophs, 0, sizeof(xcb_property_handlers_t));
 
     xcb_event_handlers_init(conn, &evenths);
+    xcb_property_handlers_init(&prophs, &evenths);
     xcb_event_set_key_press_handler(&evenths, handle_key_press, NULL);
 
     xcb_event_set_button_press_handler(&evenths, handle_button_press, NULL);
@@ -308,6 +312,7 @@ int main(int argc, char *argv[]) {
 
     xcb_event_set_expose_handler(&evenths, handle_expose_event, NULL);
 
+
     /* Setup NetWM atoms */
     #define GET_ATOM(name) \
         do { \
@@ -342,6 +347,8 @@ int main(int argc, char *argv[]) {
     GET_ATOM(_NET_ACTIVE_WINDOW);
     GET_ATOM(_NET_WORKAREA);
 
+    xcb_property_set_handler(&prophs, atoms[_NET_WM_NAME], 128, handle_windowname_change, NULL);
+
     keysyms = xcb_key_symbols_alloc(conn);
 
     xcb_get_numlock_mask(conn);