aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Kenny Levinsen <kl@kl.wtf>2020-06-03 14:39:12 +0200
committerLibravatar Simon Ser <contact@emersion.fr>2020-06-03 16:41:17 +0200
commit5a4a7bc0dad1bb07312f41d6cce9b5a6fc8d884d (patch)
tree26824b89fe15a3ffc4876d1dba6a6c4ca99866a8
parenttransaction: Improve transaction commentary (diff)
downloadsway-5a4a7bc0dad1bb07312f41d6cce9b5a6fc8d884d.tar.gz
sway-5a4a7bc0dad1bb07312f41d6cce9b5a6fc8d884d.tar.zst
sway-5a4a7bc0dad1bb07312f41d6cce9b5a6fc8d884d.zip
container: Remove useless surface dimensions
The adjustments to resize logic left them unnecessary.
-rw-r--r--include/sway/tree/container.h1
-rw-r--r--sway/desktop/output.c8
-rw-r--r--sway/desktop/transaction.c2
-rw-r--r--sway/desktop/xdg_shell.c5
-rw-r--r--sway/desktop/xwayland.c5
-rw-r--r--sway/tree/view.c2
6 files changed, 8 insertions, 15 deletions
diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h
index 2c94c772..8d2d8827 100644
--- a/include/sway/tree/container.h
+++ b/include/sway/tree/container.h
@@ -105,7 +105,6 @@ struct sway_container {
105 // refuses to resize to the content dimensions then it can be smaller. 105 // refuses to resize to the content dimensions then it can be smaller.
106 // These are in layout coordinates. 106 // These are in layout coordinates.
107 double surface_x, surface_y; 107 double surface_x, surface_y;
108 double surface_width, surface_height;
109 108
110 enum sway_fullscreen_mode fullscreen_mode; 109 enum sway_fullscreen_mode fullscreen_mode;
111 110
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index 18250ae6..2a2e332a 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -171,8 +171,8 @@ void output_view_for_each_surface(struct sway_output *output,
171 - view->geometry.x, 171 - view->geometry.x,
172 .oy = view->container->surface_y - output->ly 172 .oy = view->container->surface_y - output->ly
173 - view->geometry.y, 173 - view->geometry.y,
174 .width = view->container->surface_width, 174 .width = view->container->current.content_width,
175 .height = view->container->surface_height, 175 .height = view->container->current.content_height,
176 .rotation = 0, // TODO 176 .rotation = 0, // TODO
177 }; 177 };
178 178
@@ -191,8 +191,8 @@ void output_view_for_each_popup(struct sway_output *output,
191 - view->geometry.x, 191 - view->geometry.x,
192 .oy = view->container->surface_y - output->ly 192 .oy = view->container->surface_y - output->ly
193 - view->geometry.y, 193 - view->geometry.y,
194 .width = view->container->surface_width, 194 .width = view->container->current.content_width,
195 .height = view->container->surface_height, 195 .height = view->container->current.content_height,
196 .rotation = 0, // TODO 196 .rotation = 0, // TODO
197 }; 197 };
198 198
diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c
index 053312a5..7b9ab586 100644
--- a/sway/desktop/transaction.c
+++ b/sway/desktop/transaction.c
@@ -267,8 +267,6 @@ static void apply_container_state(struct sway_container *container,
267 } else { 267 } else {
268 container->surface_y = container->current.content_y; 268 container->surface_y = container->current.content_y;
269 } 269 }
270 container->surface_width = container->current.content_width;
271 container->surface_height = container->current.content_height;
272 } 270 }
273 271
274 if (!container->node.destroying) { 272 if (!container->node.destroying) {
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c
index 01574577..7775f660 100644
--- a/sway/desktop/xdg_shell.c
+++ b/sway/desktop/xdg_shell.c
@@ -282,10 +282,9 @@ static void handle_commit(struct wl_listener *listener, void *data) {
282 } else { 282 } else {
283 struct wlr_box new_geo; 283 struct wlr_box new_geo;
284 wlr_xdg_surface_get_geometry(xdg_surface, &new_geo); 284 wlr_xdg_surface_get_geometry(xdg_surface, &new_geo);
285 struct sway_container *con = view->container;
286 285
287 if ((new_geo.width != con->surface_width || 286 if ((new_geo.width != view->geometry.width ||
288 new_geo.height != con->surface_height)) { 287 new_geo.height != view->geometry.height)) {
289 // The view has unexpectedly sent a new size 288 // The view has unexpectedly sent a new size
290 desktop_damage_view(view); 289 desktop_damage_view(view);
291 view_update_size(view, new_geo.width, new_geo.height); 290 view_update_size(view, new_geo.width, new_geo.height);
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index 4bf5b6b8..b51bbb74 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -371,10 +371,9 @@ static void handle_commit(struct wl_listener *listener, void *data) {
371 } else { 371 } else {
372 struct wlr_box new_geo; 372 struct wlr_box new_geo;
373 get_geometry(view, &new_geo); 373 get_geometry(view, &new_geo);
374 struct sway_container *con = view->container;
375 374
376 if ((new_geo.width != con->surface_width || 375 if ((new_geo.width != view->geometry.width ||
377 new_geo.height != con->surface_height)) { 376 new_geo.height != view->geometry.height)) {
378 // The view has unexpectedly sent a new size 377 // The view has unexpectedly sent a new size
379 // eg. The Firefox "Save As" dialog when downloading a file 378 // eg. The Firefox "Save As" dialog when downloading a file
380 desktop_damage_view(view); 379 desktop_damage_view(view);
diff --git a/sway/tree/view.c b/sway/tree/view.c
index 711ab7aa..a9034637 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -737,8 +737,6 @@ void view_update_size(struct sway_view *view, int width, int height) {
737 con->surface_x = fmax(con->surface_x, con->content_x); 737 con->surface_x = fmax(con->surface_x, con->content_x);
738 con->surface_y = fmax(con->surface_y, con->content_y); 738 con->surface_y = fmax(con->surface_y, con->content_y);
739 } 739 }
740 con->surface_width = width;
741 con->surface_height = height;
742} 740}
743 741
744static const struct sway_view_child_impl subsurface_impl; 742static const struct sway_view_child_impl subsurface_impl;