From c9ce8bf1bd0f4cfb459bcb7d3ec45429c0a81293 Mon Sep 17 00:00:00 2001 From: Luminarys Date: Mon, 17 Aug 2015 10:34:39 -0500 Subject: [PATCH] Style and other minor fixes --- include/container.h | 8 ++++---- sway/container.c | 4 ++-- sway/handlers.c | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/container.h b/include/container.h index 3136e5656..e395a55b3 100644 --- a/include/container.h +++ b/include/container.h @@ -36,14 +36,14 @@ struct sway_container { // Not including borders or margins int width, height; - // Used for setting floating geometry - int desired_width, desired_height; + // Used for setting floating geometry + int desired_width, desired_height; int x, y; bool visible; - bool is_floating; + bool is_floating; int weight; @@ -51,7 +51,7 @@ struct sway_container { list_t *children; - // Special list for floating windows in workspaces + // Special list for floating windows in workspaces list_t *floating; struct sway_container *parent; diff --git a/sway/container.c b/sway/container.c index 1f93d4dc5..231876c5a 100644 --- a/sway/container.c +++ b/sway/container.c @@ -170,8 +170,8 @@ swayc_t *new_floating_view(wlc_handle handle) { view->width = geometry->size.w; view->height = geometry->size.h; - view->desired_width = -1; - view->desired_height = -1; + view->desired_width = view->width; + view->desired_height = view->height; view->is_floating = true; diff --git a/sway/handlers.c b/sway/handlers.c index 85df09f70..77e8f237d 100644 --- a/sway/handlers.c +++ b/sway/handlers.c @@ -167,16 +167,16 @@ static void handle_view_geometry_request(wlc_handle handle, const struct wlc_geo // This will not do anything for the time being as WLC improperly sends geometry requests swayc_t *view = get_swayc_for_handle(handle, &root_container); if (view) { + view->desired_width = geometry->size.w; + view->desired_height = geometry->size.h; + if (view->is_floating) { - view->width = geometry->size.w; - view->height = geometry->size.h; + view->width = view->desired_width; + view->height = view->desired_height; view->x = geometry->origin.x; view->y = geometry->origin.y; arrange_windows(view->parent, -1, -1); - } else { - view->desired_width = geometry->size.w; - view->desired_height = geometry->size.h; - } + } } }