aboutsummaryrefslogtreecommitdiff
path: root/rootston/desktop.c
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-01-28 10:11:31 +0100
committeremersion <contact@emersion.fr>2018-01-28 10:11:31 +0100
commit63736be2143a1821fe0b378e56c7e70f1f3cafec (patch)
tree86cdddae4c9651a1f1042588c02854636cea2f76 /rootston/desktop.c
parent861d5bdff2e33e453fdddc26cdeef2233c2f8ea7 (diff)
rootston: fix damage tracking for SSD
Diffstat (limited to 'rootston/desktop.c')
-rw-r--r--rootston/desktop.c25
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 &&