rootston: damage views when moved

This commit is contained in:
emersion 2018-01-18 12:25:39 +01:00
parent 5089f2d9fb
commit 01bcc2ab01
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
7 changed files with 52 additions and 33 deletions

View file

@ -61,8 +61,7 @@ void view_move(struct roots_view *view, double x, double y) {
if (view->move) {
view->move(view, x, y);
} else {
view->x = x;
view->y = y;
view_update_position(view, x, y);
}
view_update_output(view, &before);
}
@ -268,6 +267,7 @@ void view_destroy(struct roots_view *view) {
void view_init(struct roots_view *view, struct roots_desktop *desktop) {
view->desktop = desktop;
wl_signal_init(&view->events.destroy);
view_damage(view);
}
void view_setup(struct roots_view *view) {
@ -282,6 +282,20 @@ void view_setup(struct roots_view *view) {
view_update_output(view, NULL);
}
void view_damage(struct roots_view *view) {
struct roots_output *output;
wl_list_for_each(output, &view->desktop->outputs, link) {
output_damage_view(output, view);
}
}
void view_update_position(struct roots_view *view, double x, double y) {
view_damage(view);
view->x = x;
view->y = y;
view_damage(view);
}
static bool view_at(struct roots_view *view, double lx, double ly,
struct wlr_surface **surface, double *sx, double *sy) {
if (view->type == ROOTS_WL_SHELL_VIEW &&
@ -522,11 +536,3 @@ struct roots_output *desktop_output_from_wlr_output(
}
return NULL;
}
void desktop_damage_surface(struct roots_desktop *desktop,
struct wlr_surface *surface, double lx, double ly) {
struct roots_output *output;
wl_list_for_each(output, &desktop->outputs, link) {
output_damage_surface(output, surface, lx, ly);
}
}