aboutsummaryrefslogtreecommitdiff
path: root/rootston
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2018-04-24 08:51:32 +0200
committerGuido Günther <agx@sigxcpu.org>2018-04-24 13:11:42 +0200
commitc4dff67e000e3d97315610e033ea89b3dbad7c0a (patch)
tree5f86b8fdeca07829493e8407a973a45d536e6007 /rootston
parentc0831344aae7f103a077c836abbd5c9553c6ae95 (diff)
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.
Diffstat (limited to 'rootston')
-rw-r--r--rootston/layer_shell.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/rootston/layer_shell.c b/rootston/layer_shell.c
index 071467e0..7b3e8a9d 100644
--- a/rootston/layer_shell.c
+++ b/rootston/layer_shell.c
@@ -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) {