diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-09-01 21:28:13 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-09-01 21:28:13 +1000 |
commit | 016d0455f809ac3b8da8a040611d691b96502c15 (patch) | |
tree | 3b6131e483dfb9abb40de08c03d19b82d5c20137 | |
parent | 1f1b1b34d6398d463658317dea06f640482f3caa (diff) |
Implement deprecated new_window and new_float commands
May as well make it as easy as possible for users who are coming from
i3.
This also changes the `border` command to accept a thickness when
setting the border to normal. This makes it work the same way as the
`default_border` command. Eg. `border normal 5`
-rw-r--r-- | sway/commands.c | 2 | ||||
-rw-r--r-- | sway/commands/border.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/sway/commands.c b/sway/commands.c index d9c54adc..13f5983e 100644 --- a/sway/commands.c +++ b/sway/commands.c @@ -118,6 +118,8 @@ static struct cmd_handler handlers[] = { { "input", cmd_input }, { "mode", cmd_mode }, { "mouse_warping", cmd_mouse_warping }, + { "new_float", cmd_default_floating_border }, + { "new_window", cmd_default_border }, { "no_focus", cmd_no_focus }, { "output", cmd_output }, { "seat", cmd_seat }, diff --git a/sway/commands/border.c b/sway/commands/border.c index 9c19e20a..9502c877 100644 --- a/sway/commands/border.c +++ b/sway/commands/border.c @@ -27,9 +27,6 @@ struct cmd_results *cmd_border(int argc, char **argv) { view->border = B_NORMAL; } else if (strcmp(argv[0], "pixel") == 0) { view->border = B_PIXEL; - if (argc == 2) { - view->border_thickness = atoi(argv[1]); - } } else if (strcmp(argv[0], "toggle") == 0) { view->border = (view->border + 1) % 3; } else { @@ -37,6 +34,9 @@ struct cmd_results *cmd_border(int argc, char **argv) { "Expected 'border <none|normal|pixel|toggle>' " "or 'border pixel <px>'"); } + if (argc == 2) { + view->border_thickness = atoi(argv[1]); + } if (container_is_floating(view->swayc)) { container_set_geometry_from_floating_view(view->swayc); |