diff options
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r-- | sway/tree/view.c | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c index 4c8e1774..7a2c1950 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c | |||
@@ -618,34 +618,16 @@ void view_unmap(struct sway_view *view) { | |||
618 | view->surface = NULL; | 618 | view->surface = NULL; |
619 | } | 619 | } |
620 | 620 | ||
621 | void view_update_position(struct sway_view *view, double lx, double ly) { | ||
622 | if (view->x == lx && view->y == ly) { | ||
623 | return; | ||
624 | } | ||
625 | container_damage_whole(view->swayc); | ||
626 | view->x = lx; | ||
627 | view->y = ly; | ||
628 | view->swayc->current.view_x = lx; | ||
629 | view->swayc->current.view_y = ly; | ||
630 | if (container_is_floating(view->swayc)) { | ||
631 | container_set_geometry_from_floating_view(view->swayc); | ||
632 | } | ||
633 | container_damage_whole(view->swayc); | ||
634 | } | ||
635 | |||
636 | void view_update_size(struct sway_view *view, int width, int height) { | 621 | void view_update_size(struct sway_view *view, int width, int height) { |
637 | if (view->width == width && view->height == height) { | 622 | if (!sway_assert(container_is_floating(view->swayc), |
623 | "Expected a floating container")) { | ||
638 | return; | 624 | return; |
639 | } | 625 | } |
640 | container_damage_whole(view->swayc); | ||
641 | view->width = width; | 626 | view->width = width; |
642 | view->height = height; | 627 | view->height = height; |
643 | view->swayc->current.view_width = width; | 628 | view->swayc->current.view_width = width; |
644 | view->swayc->current.view_height = height; | 629 | view->swayc->current.view_height = height; |
645 | if (container_is_floating(view->swayc)) { | 630 | container_set_geometry_from_floating_view(view->swayc); |
646 | container_set_geometry_from_floating_view(view->swayc); | ||
647 | } | ||
648 | container_damage_whole(view->swayc); | ||
649 | } | 631 | } |
650 | 632 | ||
651 | static void view_subsurface_create(struct sway_view *view, | 633 | static void view_subsurface_create(struct sway_view *view, |