aboutsummaryrefslogtreecommitdiff
path: root/rootston
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-04-24 13:16:44 +0200
committerGitHub <noreply@github.com>2018-04-24 13:16:44 +0200
commita6790d45b2b25f38754403fe692ee9304aefc5fc (patch)
tree8e1088d18ba4c149b05785c279bf6f5d8e99d11b /rootston
parent09b491f36c43e811671af9372ce84e422da1d207 (diff)
parent24fa07565d407d95414b803d0490c725dd242901 (diff)
Merge pull request #895 from agx/layer-shell-popup-damage
layer-shell: use output_damage_{whole,from}_local_surface
Diffstat (limited to 'rootston')
-rw-r--r--rootston/layer_shell.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/rootston/layer_shell.c b/rootston/layer_shell.c
index 071467e0..836deb42 100644
--- a/rootston/layer_shell.c
+++ b/rootston/layer_shell.c
@@ -255,7 +255,8 @@ static void unmap(struct wlr_layer_surface *layer_surface) {
struct wlr_output *wlr_output = layer_surface->output;
if (wlr_output != NULL) {
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 wlr_output *wlr_output = layer_surface->output;
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);
}
@@ -297,11 +299,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 +310,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 +321,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) {