aboutsummaryrefslogtreecommitdiff
path: root/sway/container.c
diff options
context:
space:
mode:
authorMikkel Oscar Lyderik <mikkeloscar@gmail.com>2016-03-31 12:17:21 +0200
committerMikkel Oscar Lyderik <mikkeloscar@gmail.com>2016-03-31 12:42:20 +0200
commit7be476c115d4890f15503853aa36cf0059c8fca8 (patch)
tree07a3e095719d9bfbd2206e17e33e4abade2bf86d /sway/container.c
parent6db92bbb99461791156b702fc84605f419707384 (diff)
Add cmds new_window and new_float
Makes it possible to set default layout style for new windows and new floating windows. Close #556
Diffstat (limited to 'sway/container.c')
-rw-r--r--sway/container.c10
1 files changed, 7 insertions, 3 deletions
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