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.
This commit is contained in:
Daniel Eklöf 2020-02-29 11:40:41 +01:00
parent 5717a0dfb0
commit 601dc02ea1
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -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);
}