sway

i3-compatible Wayland compositor
git clone https://git.awy.one/sway
Log | Files | Refs | README | LICENSE

commit 5a4a7bc0dad1bb07312f41d6cce9b5a6fc8d884d
parent 7670f1a521e6eacf41385324eba7cc453de9942c
Author: Kenny Levinsen <kl@kl.wtf>
Date:   Wed,  3 Jun 2020 14:39:12 +0200

container: Remove useless surface dimensions

The adjustments to resize logic left them unnecessary.

Diffstat:
Minclude/sway/tree/container.h | 1-
Msway/desktop/output.c | 8++++----
Msway/desktop/transaction.c | 2--
Msway/desktop/xdg_shell.c | 5++---
Msway/desktop/xwayland.c | 5++---
Msway/tree/view.c | 2--
6 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h @@ -105,7 +105,6 @@ struct sway_container { // refuses to resize to the content dimensions then it can be smaller. // These are in layout coordinates. double surface_x, surface_y; - double surface_width, surface_height; enum sway_fullscreen_mode fullscreen_mode; diff --git a/sway/desktop/output.c b/sway/desktop/output.c @@ -171,8 +171,8 @@ void output_view_for_each_surface(struct sway_output *output, - view->geometry.x, .oy = view->container->surface_y - output->ly - view->geometry.y, - .width = view->container->surface_width, - .height = view->container->surface_height, + .width = view->container->current.content_width, + .height = view->container->current.content_height, .rotation = 0, // TODO }; @@ -191,8 +191,8 @@ void output_view_for_each_popup(struct sway_output *output, - view->geometry.x, .oy = view->container->surface_y - output->ly - view->geometry.y, - .width = view->container->surface_width, - .height = view->container->surface_height, + .width = view->container->current.content_width, + .height = view->container->current.content_height, .rotation = 0, // TODO }; diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c @@ -267,8 +267,6 @@ static void apply_container_state(struct sway_container *container, } else { container->surface_y = container->current.content_y; } - container->surface_width = container->current.content_width; - container->surface_height = container->current.content_height; } if (!container->node.destroying) { diff --git 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) { } else { struct wlr_box new_geo; wlr_xdg_surface_get_geometry(xdg_surface, &new_geo); - struct sway_container *con = view->container; - if ((new_geo.width != con->surface_width || - new_geo.height != con->surface_height)) { + if ((new_geo.width != view->geometry.width || + new_geo.height != view->geometry.height)) { // The view has unexpectedly sent a new size desktop_damage_view(view); view_update_size(view, new_geo.width, new_geo.height); diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c @@ -371,10 +371,9 @@ static void handle_commit(struct wl_listener *listener, void *data) { } else { struct wlr_box new_geo; get_geometry(view, &new_geo); - struct sway_container *con = view->container; - if ((new_geo.width != con->surface_width || - new_geo.height != con->surface_height)) { + if ((new_geo.width != view->geometry.width || + new_geo.height != view->geometry.height)) { // The view has unexpectedly sent a new size // eg. The Firefox "Save As" dialog when downloading a file desktop_damage_view(view); diff --git 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) { con->surface_x = fmax(con->surface_x, con->content_x); con->surface_y = fmax(con->surface_y, con->content_y); } - con->surface_width = width; - con->surface_height = height; } static const struct sway_view_child_impl subsurface_impl;