From 7be476c115d4890f15503853aa36cf0059c8fca8 Mon Sep 17 00:00:00 2001 From: Mikkel Oscar Lyderik Date: Thu, 31 Mar 2016 12:17:21 +0200 Subject: Add cmds new_window and new_float Makes it possible to set default layout style for new windows and new floating windows. Close #556 --- sway/container.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'sway/container.c') diff --git a/sway/container.c b/sway/container.c index 21a929b9..6b69d6b6 100644 --- a/sway/container.c +++ b/sway/container.c @@ -22,11 +22,8 @@ static swayc_t *new_swayc(enum swayc_types type) { c->gaps = -1; c->layout = L_NONE; c->type = type; - c->border_type = config->border; - c->border_thickness = config->border_thickness; if (type != C_VIEW) { c->children = create_list(); - c->border_type = B_NONE; } return c; } @@ -275,6 +272,9 @@ swayc_t *new_view(swayc_t *sibling, wlc_handle handle) { view->height = 0; view->desired_width = geometry.size.w; view->desired_height = geometry.size.h; + // setup border + view->border_type = config->border; + view->border_thickness = config->border_thickness; view->is_floating = false; @@ -319,6 +319,10 @@ swayc_t *new_floating_view(wlc_handle handle) { view->desired_width = view->width; view->desired_height = view->height; + // setup border + view->border_type = config->floating_border; + view->border_thickness = config->floating_border_thickness; + view->is_floating = true; // Case of focused workspace, just create as child of it -- cgit v1.2.3