summaryrefslogtreecommitdiffstats
path: root/sway/border.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/border.c')
-rw-r--r--sway/border.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/sway/border.c b/sway/border.c
index d79029a9..10ad92c2 100644
--- a/sway/border.c
+++ b/sway/border.c
@@ -1,8 +1,11 @@
1#define _XOPEN_SOURCE 500
1#include <wlc/wlc-render.h> 2#include <wlc/wlc-render.h>
2#include <cairo/cairo.h> 3#include <cairo/cairo.h>
3#include <pango/pangocairo.h> 4#include <pango/pangocairo.h>
4#include <stdlib.h> 5#include <stdlib.h>
5#include <stdio.h> 6#include <stdio.h>
7#include <string.h>
8#include <strings.h>
6#include <arpa/inet.h> 9#include <arpa/inet.h>
7#include "sway/border.h" 10#include "sway/border.h"
8#include "sway/container.h" 11#include "sway/container.h"
@@ -190,6 +193,26 @@ static void render_title_bar(swayc_t *view, cairo_t *cr, struct wlc_geometry *b,
190 cairo_set_source_u32(cr, colors->text); 193 cairo_set_source_u32(cr, colors->text);
191 pango_printf(cr, config->font, 1, false, "%s", view->name); 194 pango_printf(cr, config->font, 1, false, "%s", view->name);
192 } 195 }
196 // Marks
197 if (config->show_marks && view->marks) {
198 int total_len = 0;
199
200 for(int i = view->marks->length - 1; i >= 0; --i) {
201 char *mark = (char *)view->marks->items[i];
202 if (*mark != '_') {
203 int width, height;
204 get_text_size(cr, config->font, &width, &height, 1, false, "[%s]", mark);
205 total_len += width;
206 if ((int)tb->size.w + x - (total_len + 2) < x + 2) {
207 break;
208 } else {
209 cairo_move_to(cr, (int)tb->size.w + x - (total_len + 2), y + 2);
210 cairo_set_source_u32(cr, colors->text);
211 pango_printf(cr, config->font, 1, false, "[%s]", mark);
212 }
213 }
214 }
215 }
193 216
194 // titlebars has a border all around for tabbed layouts 217 // titlebars has a border all around for tabbed layouts
195 if (view->parent->layout == L_TABBED) { 218 if (view->parent->layout == L_TABBED) {