aboutsummaryrefslogtreecommitdiff
path: root/sway/commands.c
diff options
context:
space:
mode:
authorcrondog <crondog@gmail.com>2015-12-30 13:41:01 +1100
committercrondog <crondog@gmail.com>2015-12-30 13:50:50 +1100
commit596c4d9428bbb71e0e76d8532b3e7ae2df9959d2 (patch)
treef4fc34b1e69b206b7ccf8368239762839ce68936 /sway/commands.c
parent1f4a590c18e123e7e44bacd3b7890ebcaf084b80 (diff)
Dont try and fullscreen a workspace with no views
Found this completely by accident
Diffstat (limited to 'sway/commands.c')
-rw-r--r--sway/commands.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sway/commands.c b/sway/commands.c
index fe341cd5..4d5018a0 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -1435,6 +1435,9 @@ static struct cmd_results *cmd_fullscreen(int argc, char **argv) {
return error;
}
swayc_t *container = get_focused_view(&root_container);
+ if(container->type != C_VIEW){
+ return cmd_results_new(CMD_INVALID, "fullscreen", "Only views can fullscreen");
+ }
swayc_t *workspace = swayc_parent_by_type(container, C_WORKSPACE);
bool current = swayc_is_fullscreen(container);
wlc_view_set_state(container->handle, WLC_BIT_FULLSCREEN, !current);