aboutsummaryrefslogtreecommitdiff
path: root/sway/commands/fullscreen.c
diff options
context:
space:
mode:
authorRyan Dwyer <RyanDwyer@users.noreply.github.com>2018-07-24 19:23:04 +1000
committerGitHub <noreply@github.com>2018-07-24 19:23:04 +1000
commite02a6718c2c7313309b45e499034d614ee6207fc (patch)
tree429de47906f0ba1f114689c48cbabc5be8bb6e71 /sway/commands/fullscreen.c
parent94dd8823a0081f7983dce368d5d093d1d3eeaefe (diff)
parent6ccf2a2c66c1264450a4b3ab3dd344e1b3b44ca3 (diff)
downloadsway-e02a6718c2c7313309b45e499034d614ee6207fc.tar.xz
Merge branch 'master' into mouse-bindings
Diffstat (limited to 'sway/commands/fullscreen.c')
-rw-r--r--sway/commands/fullscreen.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/sway/commands/fullscreen.c b/sway/commands/fullscreen.c
index 0b5beaa2..b423fd23 100644
--- a/sway/commands/fullscreen.c
+++ b/sway/commands/fullscreen.c
@@ -5,6 +5,7 @@
#include "sway/tree/container.h"
#include "sway/tree/view.h"
#include "sway/tree/layout.h"
+#include "util.h"
struct cmd_results *cmd_fullscreen(int argc, char **argv) {
struct cmd_results *error = NULL;
@@ -18,17 +19,10 @@ struct cmd_results *cmd_fullscreen(int argc, char **argv) {
"Only views can fullscreen");
}
struct sway_view *view = container->sway_view;
- bool wants_fullscreen;
+ bool wants_fullscreen = !view->is_fullscreen;
- if (argc == 0 || strcmp(argv[0], "toggle") == 0) {
- wants_fullscreen = !view->is_fullscreen;
- } else if (strcmp(argv[0], "enable") == 0) {
- wants_fullscreen = true;
- } else if (strcmp(argv[0], "disable") == 0) {
- wants_fullscreen = false;
- } else {
- return cmd_results_new(CMD_INVALID, "fullscreen",
- "Expected 'fullscreen' or 'fullscreen <enable|disable|toggle>'");
+ if (argc) {
+ wants_fullscreen = parse_boolean(argv[0], view->is_fullscreen);
}
view_set_fullscreen(view, wants_fullscreen);