aboutsummaryrefslogtreecommitdiff
path: root/render.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-02-29 10:40:41 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-02-29 10:40:41 +0000
commit601dc02ea1758f6690fffa925bffb959ba300739 (patch)
tree4791b89f5507033bdd552d5cd09cfe28185d8891 /render.c
parentconfig: change default geometry from 800x600 -> 700x500 (diff)
render: wl_subsurface_set_position() uses un-scaled coordinates
This fixes an issue where the CSDs and the search box was incorrectly positioned when output's scale != 1.
Diffstat (limited to 'render.c')
-rw-r--r--render.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/render.c b/render.c
index 74c683dd..6d3e7180 100644
--- a/render.c
+++ b/render.c
@@ -744,7 +744,7 @@ render_csd(struct terminal *term)
&(pixman_rectangle16_t){0, 0, buf->width, buf->height});
pixman_image_unref(src);
- wl_subsurface_set_position(sub, x, y);
+ wl_subsurface_set_position(sub, x / term->scale, y / term->scale);
wl_surface_attach(surf, buf->wl_buf, 0, 0);
//wl_surface_set_opaque_region(surf, region);
@@ -1156,8 +1156,8 @@ render_search_box(struct terminal *term)
wl_subsurface_set_position(
term->window->search_sub_surface,
- max(0, (int32_t)term->width - width - margin),
- max(0, (int32_t)term->height - height - margin));
+ max(0, (int32_t)term->width - width - margin) / scale,
+ max(0, (int32_t)term->height - height - margin) / scale);
wl_surface_commit(term->window->search_surface);
}