aboutsummaryrefslogtreecommitdiff
path: root/render.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-10-09 05:41:39 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-10-09 05:41:39 +0000
commitb10d93b0efe657d25e6615e45d5d6b84f069a06c (patch)
treed5612e8d8fe89006f3c634d64cbd4c8d921ea71a /render.c
parentdoc: foot.1: remove ‘--’ from example command line (diff)
parentdoc: foot.ini: bell/urgency: add note about this getting replaced in the future (diff)
Merge branch 'bell-triggers-faked-urgency' into master
Closes #157
Diffstat (limited to 'render.c')
-rw-r--r--render.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/render.c b/render.c
index 20d66512..427c8d44 100644
--- a/render.c
+++ b/render.c
@@ -542,6 +542,35 @@ draw_cursor:
}
static void
+render_urgency(struct terminal *term, struct buffer *buf)
+{
+ uint32_t red = term->colors.table[1];
+ pixman_color_t bg = color_hex_to_pixman(red);
+
+ if (term->is_searching)
+ color_dim(&bg);
+
+ int width = min(min(term->margins.left, term->margins.right),
+ min(term->margins.top, term->margins.bottom));
+
+ pixman_image_fill_rectangles(
+ PIXMAN_OP_SRC, buf->pix[0], &bg, 4,
+ (pixman_rectangle16_t[]){
+ /* Top */
+ {0, 0, term->width, width},
+
+ /* Bottom */
+ {0, term->height - width, term->width, width},
+
+ /* Left */
+ {0, width, width, term->height - 2 * width},
+
+ /* Right */
+ {term->width - width, width, width, term->height - 2 * width},
+ });
+}
+
+static void
render_margin(struct terminal *term, struct buffer *buf,
int start_line, int end_line, bool apply_damage)
{
@@ -578,6 +607,9 @@ render_margin(struct terminal *term, struct buffer *buf,
term->margins.right, line_count * term->cell_height},
});
+ if (term->render.urgency)
+ render_urgency(term, buf);
+
if (apply_damage) {
/* Top */
wl_surface_damage_buffer(