diff options
author | Ryan Dwyer <RyanDwyer@users.noreply.github.com> | 2018-08-19 16:07:11 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-19 16:07:11 +1000 |
commit | 7f22fab3895ff090d5e26936f4e964e081090164 (patch) | |
tree | c5d96041e3270b1d1d50f8a42d91652d615c9938 /sway/tree/view.c | |
parent | commands: move newly-stickied containers to focused workspace (diff) | |
parent | Merge pull request #2466 from RyanDwyer/geometry (diff) | |
download | sway-7f22fab3895ff090d5e26936f4e964e081090164.tar.gz sway-7f22fab3895ff090d5e26936f4e964e081090164.tar.zst sway-7f22fab3895ff090d5e26936f4e964e081090164.zip |
Merge branch 'master' into commands
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, |