Merge pull request #895 from agx/layer-shell-popup-damage

layer-shell: use output_damage_{whole,from}_local_surface
This commit is contained in:
Drew DeVault 2018-04-24 13:16:44 +02:00 committed by GitHub
commit a6790d45b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 17 deletions

View File

@ -255,7 +255,8 @@ static void unmap(struct wlr_layer_surface *layer_surface) {
struct wlr_output *wlr_output = layer_surface->output; struct wlr_output *wlr_output = layer_surface->output;
if (wlr_output != NULL) { if (wlr_output != NULL) {
struct roots_output *output = wlr_output->data; struct roots_output *output = wlr_output->data;
wlr_output_damage_add_box(output->damage, &layer->geo); output_damage_whole_local_surface(output, layer_surface->surface,
layer->geo.x, layer->geo.y, 0);
} }
} }
@ -282,7 +283,8 @@ static void handle_map(struct wl_listener *listener, void *data) {
struct roots_layer_surface *layer = layer_surface->data; struct roots_layer_surface *layer = layer_surface->data;
struct wlr_output *wlr_output = layer_surface->output; struct wlr_output *wlr_output = layer_surface->output;
struct roots_output *output = wlr_output->data; struct roots_output *output = wlr_output->data;
wlr_output_damage_add_box(output->damage, &layer->geo); output_damage_whole_local_surface(output, layer_surface->surface,
layer->geo.x, layer->geo.y, 0);
wlr_surface_send_enter(layer_surface->surface, wlr_output); wlr_surface_send_enter(layer_surface->surface, wlr_output);
} }
@ -297,11 +299,10 @@ static void popup_handle_map(struct wl_listener *listener, void *data) {
struct roots_layer_surface *layer = popup->parent; struct roots_layer_surface *layer = popup->parent;
struct wlr_output *wlr_output = layer->layer_surface->output; struct wlr_output *wlr_output = layer->layer_surface->output;
struct roots_output *output = wlr_output->data; struct roots_output *output = wlr_output->data;
struct wlr_box geom; int ox = popup->wlr_popup->geometry.x + layer->geo.x;
memcpy(&geom, &popup->wlr_popup->geometry, sizeof(struct wlr_box)); int oy = popup->wlr_popup->geometry.y + layer->geo.y;
geom.x += layer->geo.x; output_damage_whole_local_surface(output, popup->wlr_popup->base->surface,
geom.y += layer->geo.y; ox, oy, 0);
wlr_output_damage_add_box(output->damage, &geom);
} }
static void popup_handle_unmap(struct wl_listener *listener, void *data) { static void popup_handle_unmap(struct wl_listener *listener, void *data) {
@ -309,11 +310,10 @@ static void popup_handle_unmap(struct wl_listener *listener, void *data) {
struct roots_layer_surface *layer = popup->parent; struct roots_layer_surface *layer = popup->parent;
struct wlr_output *wlr_output = layer->layer_surface->output; struct wlr_output *wlr_output = layer->layer_surface->output;
struct roots_output *output = wlr_output->data; struct roots_output *output = wlr_output->data;
struct wlr_box geom; int ox = popup->wlr_popup->geometry.x + layer->geo.x;
memcpy(&geom, &popup->wlr_popup->geometry, sizeof(struct wlr_box)); int oy = popup->wlr_popup->geometry.y + layer->geo.y;
geom.x += layer->geo.x; output_damage_whole_local_surface(output, popup->wlr_popup->base->surface,
geom.y += layer->geo.y; ox, oy, 0);
wlr_output_damage_add_box(output->damage, &geom);
} }
static void popup_handle_commit(struct wl_listener *listener, void *data) { static void popup_handle_commit(struct wl_listener *listener, void *data) {
@ -321,11 +321,10 @@ static void popup_handle_commit(struct wl_listener *listener, void *data) {
struct roots_layer_surface *layer = popup->parent; struct roots_layer_surface *layer = popup->parent;
struct wlr_output *wlr_output = layer->layer_surface->output; struct wlr_output *wlr_output = layer->layer_surface->output;
struct roots_output *output = wlr_output->data; struct roots_output *output = wlr_output->data;
struct wlr_box geom; int ox = popup->wlr_popup->geometry.x + layer->geo.x;
memcpy(&geom, &popup->wlr_popup->geometry, sizeof(struct wlr_box)); int oy = popup->wlr_popup->geometry.y + layer->geo.y;
geom.x += layer->geo.x; output_damage_from_local_surface(output, popup->wlr_popup->base->surface,
geom.y += layer->geo.y; ox, oy, 0);
wlr_output_damage_add_box(output->damage, &geom);
} }
static void popup_handle_destroy(struct wl_listener *listener, void *data) { static void popup_handle_destroy(struct wl_listener *listener, void *data) {