rootston: fix damage tracking for SSD

This commit is contained in:
emersion 2018-01-28 10:11:31 +01:00
parent 861d5bdff2
commit 63736be214
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
6 changed files with 38 additions and 21 deletions

View file

@ -24,18 +24,8 @@
void view_get_box(const struct roots_view *view, struct wlr_box *box) {
box->x = view->x;
box->y = view->y;
if (view->get_size) {
view->get_size(view, box);
} else {
if (view->wlr_surface == NULL) {
// View is unmapped
box->width = box->height = 0;
return;
}
box->width = view->wlr_surface->current->width;
box->height = view->wlr_surface->current->height;
}
box->width = view->width;
box->height = view->height;
}
void view_get_deco_box(const struct roots_view *view, struct wlr_box *box) {
@ -469,6 +459,17 @@ void view_update_position(struct roots_view *view, double x, double y) {
view_damage_whole(view);
}
void view_update_size(struct roots_view *view, uint32_t width, uint32_t height) {
if (view->width == width && view->height == height) {
return;
}
view_damage_whole(view);
view->width = width;
view->height = height;
view_damage_whole(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 &&