]> git.sur5r.net Git - i3/i3/blobdiff - src/x.c
Make show_marks configurable
[i3/i3] / src / x.c
diff --git a/src/x.c b/src/x.c
index 1d4bfdf11fd6aa2775ffa388af9d71038ee41b7a..d29d4befeb5fb944ae748954760d0d7120cb258e 100644 (file)
--- a/src/x.c
+++ b/src/x.c
@@ -534,16 +534,16 @@ void x_draw_decoration(Con *con) {
     int indent_px = (indent_level * 5) * indent_mult;
 
     int mark_width = 0;
-    if (con->mark != NULL && (con->mark)[0] != '_') {
+    if (config.show_marks && con->mark != NULL && (con->mark)[0] != '_') {
         char *formatted_mark;
         sasprintf(&formatted_mark, "[%s]", con->mark);
         i3String *mark = i3string_from_utf8(formatted_mark);
         FREE(formatted_mark);
-        mark_width = predict_text_width(mark) + logical_px(2);
+        mark_width = predict_text_width(mark);
 
         draw_text(mark, parent->pixmap, parent->pm_gc,
-                  con->deco_rect.x + con->deco_rect.width - mark_width,
-                  con->deco_rect.y + text_offset_y, mark_width - logical_px(2));
+                  con->deco_rect.x + con->deco_rect.width - mark_width - logical_px(2),
+                  con->deco_rect.y + text_offset_y, mark_width);
 
         I3STRING_FREE(mark);
     }
@@ -551,7 +551,7 @@ void x_draw_decoration(Con *con) {
     draw_text(win->name,
               parent->pixmap, parent->pm_gc,
               con->deco_rect.x + logical_px(2) + indent_px, con->deco_rect.y + text_offset_y,
-              con->deco_rect.width - logical_px(2) - indent_px - mark_width);
+              con->deco_rect.width - logical_px(2) - indent_px - mark_width - logical_px(2));
 
 after_title:
     /* Since we don’t clip the text at all, it might in some cases be painted