From 3c713899932f10a61fa9584c498396a2aaad0d4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 3 Dec 2019 19:58:33 +0100 Subject: [PATCH] render: don't allow negative coordinates of the search surface While the protocol allows this, it appears Sway offsets (moves) the parent surface when this happens, resulting in a window half without content. --- render.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/render.c b/render.c index d17108ec..ccae7d25 100644 --- a/render.c +++ b/render.c @@ -795,7 +795,8 @@ render_search_box(struct terminal *term) wl_subsurface_set_position( term->window->search_sub_surface, - term->width - width - margin, term->height - height - margin); + max(0, term->width - width - margin), + max(0, term->height - height - margin)); wl_surface_damage_buffer(term->window->search_surface, 0, 0, width, height); wl_surface_attach(term->window->search_surface, buf->wl_buf, 0, 0);