aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-03-03 17:27:59 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-03-03 17:27:59 +0000
commitb81b1b6ff7e0a1c4bbe8eeb1216927f1dc3506b0 (patch)
tree13142d6303ff1a63c5059077cef1c5dc72388827
parentwayland: set window geometry to exclude the invisible CSD borders (diff)
render: configure a clip region to exclude the grid margins
This ensures content in the last column doesn't flow over into the margins (where they are typically never erased, unless the window is resized).
-rw-r--r--render.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/render.c b/render.c
index 82abac4d..6f8aa6b5 100644
--- a/render.c
+++ b/render.c
@@ -994,6 +994,9 @@ grid_render(struct terminal *term)
wl_surface_attach(term->window->surface, buf->wl_buf, 0, 0);
pixman_image_t *pix = buf->pix;
+ pixman_region16_t clip;
+ pixman_region_init_rect(&clip, term->margins.left, term->margins.top, term->cols * term->cell_width, term->rows * term->cell_height);
+ pixman_image_set_clip_region(pix, &clip);
/* If we resized the window, or is flashing, or just stopped flashing */
if (term->render.last_buf != buf ||
@@ -1027,6 +1030,7 @@ grid_render(struct terminal *term)
if (term->is_searching)
pixman_color_dim(&bg);
+ pixman_image_set_clip_region(pix, NULL);
pixman_image_fill_rectangles(
PIXMAN_OP_SRC, pix, &bg, 4,
(pixman_rectangle16_t[]){
@@ -1034,6 +1038,7 @@ grid_render(struct terminal *term)
{0, 0, term->margins.left, term->height}, /* Left */
{rmargin, 0, term->margins.right, term->height}, /* Right */
{0, bmargin, term->width, term->margins.bottom}}); /* Bottom */
+ pixman_image_set_clip_region(pix, &clip);
wl_surface_damage_buffer(
term->window->surface, 0, 0, term->width, term->margins.top);