]> git.sur5r.net Git - i3/i3/blobdiff - src/commands.c
Support _NET_WM_VISIBLE_NAME. As per specification this is necessary since we can...
[i3/i3] / src / commands.c
index 62adcc6536ab87b36dd02c45ce50d555e1292200..dc440f4a26d653763c9324720557d83aca6c2042 100644 (file)
@@ -1922,9 +1922,17 @@ void cmd_title_format(I3_CMD, char *format) {
 
         /* If we only display the title without anything else, we can skip the parsing step,
          * so we remove the title format altogether. */
-        if (strcasecmp(format, "%title") != 0)
+        if (strcasecmp(format, "%title") != 0) {
             current->con->window->title_format = sstrdup(format);
 
+            i3String *formatted_title = window_parse_title_format(current->con->window);
+            ewmh_update_visible_name(current->con->window->id, i3string_as_utf8(formatted_title));
+            I3STRING_FREE(formatted_title);
+        } else {
+            /* We can remove _NET_WM_VISIBLE_NAME since we don't display a custom title. */
+            ewmh_update_visible_name(current->con->window->id, NULL);
+        }
+
         /* Make sure the window title is redrawn immediately. */
         current->con->window->name_x_changed = true;
     }