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 4495c150..1c1fdb47 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c | |||
@@ -615,34 +615,16 @@ void view_unmap(struct sway_view *view) { | |||
615 | view->surface = NULL; | 615 | view->surface = NULL; |
616 | } | 616 | } |
617 | 617 | ||
618 | void view_update_position(struct sway_view *view, double lx, double ly) { | ||
619 | if (view->x == lx && view->y == ly) { | ||
620 | return; | ||
621 | } | ||
622 | container_damage_whole(view->swayc); | ||
623 | view->x = lx; | ||
624 | view->y = ly; | ||
625 | view->swayc->current.view_x = lx; | ||
626 | view->swayc->current.view_y = ly; | ||
627 | if (container_is_floating(view->swayc)) { | ||
628 | container_set_geometry_from_floating_view(view->swayc); | ||
629 | } | ||
630 | container_damage_whole(view->swayc); | ||
631 | } | ||
632 | |||
633 | void view_update_size(struct sway_view *view, int width, int height) { | 618 | void view_update_size(struct sway_view *view, int width, int height) { |
634 | if (view->width == width && view->height == height) { | 619 | if (!sway_assert(container_is_floating(view->swayc), |
620 | "Expected a floating container")) { | ||
635 | return; | 621 | return; |
636 | } | 622 | } |
637 | container_damage_whole(view->swayc); | ||
638 | view->width = width; | 623 | view->width = width; |
639 | view->height = height; | 624 | view->height = height; |
640 | view->swayc->current.view_width = width; | 625 | view->swayc->current.view_width = width; |
641 | view->swayc->current.view_height = height; | 626 | view->swayc->current.view_height = height; |
642 | if (container_is_floating(view->swayc)) { | 627 | container_set_geometry_from_floating_view(view->swayc); |
643 | container_set_geometry_from_floating_view(view->swayc); | ||
644 | } | ||
645 | container_damage_whole(view->swayc); | ||
646 | } | 628 | } |
647 | 629 | ||
648 | static void view_subsurface_create(struct sway_view *view, | 630 | static void view_subsurface_create(struct sway_view *view, |