diff options
Diffstat (limited to 'rootston/desktop.c')
-rw-r--r-- | rootston/desktop.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/rootston/desktop.c b/rootston/desktop.c index 25930d2a..9abcfa33 100644 --- a/rootston/desktop.c +++ b/rootston/desktop.c @@ -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 && |