layer-shell: use output_damage_{whole,from}_local_surface for popups

Reuse what already handles rotation and scaling. This unbreaks popups
on rotated or scaled outputs.
This commit is contained in:
Guido Günther 2018-04-24 08:51:32 +02:00
parent c0831344aa
commit c4dff67e00
1 changed files with 12 additions and 15 deletions

View File

@ -297,11 +297,10 @@ static void popup_handle_map(struct wl_listener *listener, void *data) {
struct roots_layer_surface *layer = popup->parent;
struct wlr_output *wlr_output = layer->layer_surface->output;
struct roots_output *output = wlr_output->data;
struct wlr_box geom;
memcpy(&geom, &popup->wlr_popup->geometry, sizeof(struct wlr_box));
geom.x += layer->geo.x;
geom.y += layer->geo.y;
wlr_output_damage_add_box(output->damage, &geom);
int ox = popup->wlr_popup->geometry.x + layer->geo.x;
int oy = popup->wlr_popup->geometry.y + layer->geo.y;
output_damage_whole_local_surface(output, popup->wlr_popup->base->surface,
ox, oy, 0);
}
static void popup_handle_unmap(struct wl_listener *listener, void *data) {
@ -309,11 +308,10 @@ static void popup_handle_unmap(struct wl_listener *listener, void *data) {
struct roots_layer_surface *layer = popup->parent;
struct wlr_output *wlr_output = layer->layer_surface->output;
struct roots_output *output = wlr_output->data;
struct wlr_box geom;
memcpy(&geom, &popup->wlr_popup->geometry, sizeof(struct wlr_box));
geom.x += layer->geo.x;
geom.y += layer->geo.y;
wlr_output_damage_add_box(output->damage, &geom);
int ox = popup->wlr_popup->geometry.x + layer->geo.x;
int oy = popup->wlr_popup->geometry.y + layer->geo.y;
output_damage_whole_local_surface(output, popup->wlr_popup->base->surface,
ox, oy, 0);
}
static void popup_handle_commit(struct wl_listener *listener, void *data) {
@ -321,11 +319,10 @@ static void popup_handle_commit(struct wl_listener *listener, void *data) {
struct roots_layer_surface *layer = popup->parent;
struct wlr_output *wlr_output = layer->layer_surface->output;
struct roots_output *output = wlr_output->data;
struct wlr_box geom;
memcpy(&geom, &popup->wlr_popup->geometry, sizeof(struct wlr_box));
geom.x += layer->geo.x;
geom.y += layer->geo.y;
wlr_output_damage_add_box(output->damage, &geom);
int ox = popup->wlr_popup->geometry.x + layer->geo.x;
int oy = popup->wlr_popup->geometry.y + layer->geo.y;
output_damage_from_local_surface(output, popup->wlr_popup->base->surface,
ox, oy, 0);
}
static void popup_handle_destroy(struct wl_listener *listener, void *data) {