mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
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: https://gitlab.freedesktop.org/xorg/xserver/issues/951 Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user