Merge pull request #2549 from RyanDwyer/border-improvements

Implement deprecated new_window and new_float commands
This commit is contained in:
Drew DeVault 2018-09-01 10:38:02 -04:00 committed by GitHub
commit 692dc55eca
Failed to generate hash of commit
2 changed files with 5 additions and 3 deletions

View file

@ -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 },

View file

@ -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);