aboutsummaryrefslogtreecommitdiff
path: root/sway/commands.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2015-08-19 16:15:38 -0400
committerDrew DeVault <sir@cmpwn.com>2015-08-19 16:15:38 -0400
commit532598947d2e995983017846cff66aea1ab63e95 (patch)
tree8a77cad250649625eddce7af3da1645100a3a9fa /sway/commands.c
parentc29214f348cef5951eeece3b60383993eaaca305 (diff)
parent6cc29ebbf53503a2ea72545fcdd495f5c1a89dfc (diff)
Merge pull request #90 from taiyu-len/master
floating mode_toggle
Diffstat (limited to 'sway/commands.c')
-rw-r--r--sway/commands.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sway/commands.c b/sway/commands.c
index aafa51f3..f87ab0e5 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -231,6 +231,17 @@ static bool cmd_floating(struct sway_config *config, int argc, char **argv) {
return true;
}
set_focused_container(view);
+ } else if (strcasecmp(argv[0], "mode_toggle") == 0) {
+ if (get_focused_view(active_workspace)->is_floating) {
+ if (active_workspace->children->length > 0) {
+ set_focused_container(get_focused_view(active_workspace->children->items[0]));
+ }
+ } else {
+ if (active_workspace->floating->length > 0) {
+ swayc_t *floating = active_workspace->floating->items[active_workspace->floating->length-1];
+ set_focused_container(get_focused_view(floating));
+ }
+ }
}
return true;