Commit 46e5236b authored by Olivier Fourdan's avatar Olivier Fourdan
Browse files

xwayland: Take border width into account

Damage coordinates are relative to the drawable, (0,0) being the top
left corner inside the border.

Therefore, when applying damages or accumulating damages between window
buffers, we need to take the window border width into account as well,
otherwise the updates might be only partial or misplaced.

Related: #951

Signed-off-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer's avatarMichel Dänzer <mdaenzer@redhat.com>
parent 1cb886bc
Pipeline #88610 passed with stages
in 4 minutes and 2 seconds
......@@ -286,8 +286,10 @@ xwl_window_buffers_get_pixmap(struct xwl_window *xwl_window,
while (nBox--) {
if (!copy_pixmap_area(window_pixmap,
xwl_window_buffer->pixmap,
pBox->x1, pBox->y1,
pBox->x2 - pBox->x1, pBox->y2 - pBox->y1))
pBox->x1 + xwl_window->window->borderWidth,
pBox->y1 + xwl_window->window->borderWidth,
pBox->x2 - pBox->x1,
pBox->y2 - pBox->y1))
return window_pixmap;
pBox++;
......
......@@ -1163,13 +1163,16 @@ xwl_window_post_damage(struct xwl_window *xwl_window)
*/
if (RegionNumRects(region) > 256) {
box = RegionExtents(region);
xwl_surface_damage(xwl_screen, xwl_window->surface, box->x1, box->y1,
xwl_surface_damage(xwl_screen, xwl_window->surface,
box->x1 + xwl_window->window->borderWidth,
box->y1 + xwl_window->window->borderWidth,
box->x2 - box->x1, box->y2 - box->y1);
} else {
box = RegionRects(region);
for (i = 0; i < RegionNumRects(region); i++, box++) {
xwl_surface_damage(xwl_screen, xwl_window->surface,
box->x1, box->y1,
box->x1 + xwl_window->window->borderWidth,
box->y1 + xwl_window->window->borderWidth,
box->x2 - box->x1, box->y2 - box->y1);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment