aboutsummaryrefslogtreecommitdiff
path: root/rootston
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-06-25 23:35:02 +0100
committeremersion <contact@emersion.fr>2018-07-04 19:12:17 +0100
commit233bfe2f4f7859fa293a33a5b4022eaae7eb6cb3 (patch)
tree8e64ea88124ba02669ca707943f4a418a4e0a850 /rootston
parentadf0423f7cc2758f5c0958038d5b937f531f22d6 (diff)
surface: do not monkey-patch state damage
Diffstat (limited to 'rootston')
-rw-r--r--rootston/output.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/rootston/output.c b/rootston/output.c
index aecb0d76..6abd60ae 100644
--- a/rootston/output.c
+++ b/rootston/output.c
@@ -146,6 +146,9 @@ static bool surface_intersect_output(struct wlr_surface *surface,
double ox = lx, oy = ly;
wlr_output_layout_output_coords(output_layout, wlr_output, &ox, &oy);
+ ox += surface->current.sx;
+ oy += surface->current.sy;
+
if (box != NULL) {
box->x = ox * wlr_output->scale;
box->y = oy * wlr_output->scale;
@@ -694,8 +697,9 @@ static void damage_from_surface(struct wlr_surface *surface, int sx, int sy,
pixman_region32_t damage;
pixman_region32_init(&damage);
- pixman_region32_copy(&damage, &surface->current.surface_damage);
- wlr_region_scale(&damage, &damage, wlr_output->scale);
+ pixman_region32_copy(&damage, &surface->current.damage);
+ wlr_region_scale(&damage, &damage,
+ wlr_output->scale / (float)surface->current.scale);
if (ceil(wlr_output->scale) > surface->current.scale) {
// When scaling up a surface, it'll become blurry so we need to
// expand the damage region