Fix incorrect damage being applied on popups

To reproduce:

- Open a floating window and a popup that hangs over the bottom or right
- Move the window in the direction of the popup overhang
- The previous position of the popup is damaged, not the new one
This commit is contained in:
Tadeo Kondrak 2021-01-26 13:47:54 -07:00
parent 4d43f1dd99
commit 4b2c46ada2
No known key found for this signature in database
GPG key ID: D41E092CA43F1D8B

View file

@ -238,19 +238,6 @@ static void apply_container_state(struct sway_container *container,
}
}
// Damage the new location
desktop_damage_whole_container(container);
if (view && view->surface) {
struct wlr_surface *surface = view->surface;
struct wlr_box box = {
.x = container->current.content_x - view->geometry.x,
.y = container->current.content_y - view->geometry.y,
.width = surface->current.width,
.height = surface->current.height,
};
desktop_damage_box(&box);
}
// If the view hasn't responded to the configure, center it within
// the container. This is important for fullscreen views which
// refuse to resize to the size of the output.
@ -269,6 +256,19 @@ static void apply_container_state(struct sway_container *container,
}
}
// Damage the new location
desktop_damage_whole_container(container);
if (view && view->surface) {
struct wlr_surface *surface = view->surface;
struct wlr_box box = {
.x = container->current.content_x - view->geometry.x,
.y = container->current.content_y - view->geometry.y,
.width = surface->current.width,
.height = surface->current.height,
};
desktop_damage_box(&box);
}
if (!container->node.destroying) {
container_discover_outputs(container);
}