aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenny Levinsen <kl@kl.wtf>2021-02-08 01:45:50 +0100
committerSimon Ser <contact@emersion.fr>2021-02-09 09:37:10 +0100
commit63a663516362646bd8e2a641c0aa0574f888cca3 (patch)
tree2df58443a0a67a0415514fe1b80b178fb77f963d
parent82b1019658cea14e508de04e49d23c8f9c744159 (diff)
view: Read geometry directly in view_update_size
-rw-r--r--include/sway/tree/view.h2
-rw-r--r--sway/desktop/xdg_shell.c2
-rw-r--r--sway/desktop/xwayland.c2
-rw-r--r--sway/tree/view.c6
4 files changed, 6 insertions, 6 deletions
diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h
index 18dc2019..86bd981c 100644
--- a/include/sway/tree/view.h
+++ b/include/sway/tree/view.h
@@ -316,7 +316,7 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface,
void view_unmap(struct sway_view *view);
-void view_update_size(struct sway_view *view, int width, int height);
+void view_update_size(struct sway_view *view);
void view_center_surface(struct sway_view *view);
void view_child_init(struct sway_view_child *child,
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c
index cbf16662..14880dcd 100644
--- a/sway/desktop/xdg_shell.c
+++ b/sway/desktop/xdg_shell.c
@@ -297,7 +297,7 @@ static void handle_commit(struct wl_listener *listener, void *data) {
desktop_damage_view(view);
memcpy(&view->geometry, &new_geo, sizeof(struct wlr_box));
if (container_is_floating(view->container)) {
- view_update_size(view, new_geo.width, new_geo.height);
+ view_update_size(view);
transaction_commit_dirty();
transaction_notify_view_ready_immediately(view);
} else {
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index 8b39cf50..4cd5f9d0 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -412,7 +412,7 @@ static void handle_commit(struct wl_listener *listener, void *data) {
desktop_damage_view(view);
memcpy(&view->geometry, &new_geo, sizeof(struct wlr_box));
if (container_is_floating(view->container)) {
- view_update_size(view, new_geo.width, new_geo.height);
+ view_update_size(view);
transaction_commit_dirty();
} else {
view_center_surface(view);
diff --git a/sway/tree/view.c b/sway/tree/view.c
index 38417874..e62fd018 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -872,10 +872,10 @@ void view_unmap(struct sway_view *view) {
view->surface = NULL;
}
-void view_update_size(struct sway_view *view, int width, int height) {
+void view_update_size(struct sway_view *view) {
struct sway_container *con = view->container;
- con->content_width = width;
- con->content_height = height;
+ con->content_width = view->geometry.width;
+ con->content_height = view->geometry.height;
container_set_geometry_from_content(con);
}