diff options
author | 2018-07-19 16:41:02 +1000 | |
---|---|---|
committer | 2018-07-19 16:41:02 +1000 | |
commit | 08736255a3ba16f6b810fd4eee91fe4e1ab92e35 (patch) | |
tree | 36c343206946dcea3b89eadaab9384ce16045063 /sway | |
parent | Implement focus output command (diff) | |
download | sway-08736255a3ba16f6b810fd4eee91fe4e1ab92e35.tar.gz sway-08736255a3ba16f6b810fd4eee91fe4e1ab92e35.tar.zst sway-08736255a3ba16f6b810fd4eee91fe4e1ab92e35.zip |
Defer the focus commands
Diffstat (limited to 'sway')
-rw-r--r-- | sway/commands.c | 2 | ||||
-rw-r--r-- | sway/commands/focus.c | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/sway/commands.c b/sway/commands.c index a3e6a500..73c968ea 100644 --- a/sway/commands.c +++ b/sway/commands.c | |||
@@ -103,6 +103,7 @@ static struct cmd_handler handlers[] = { | |||
103 | { "exec_always", cmd_exec_always }, | 103 | { "exec_always", cmd_exec_always }, |
104 | { "floating_maximum_size", cmd_floating_maximum_size }, | 104 | { "floating_maximum_size", cmd_floating_maximum_size }, |
105 | { "floating_minimum_size", cmd_floating_minimum_size }, | 105 | { "floating_minimum_size", cmd_floating_minimum_size }, |
106 | { "focus", cmd_focus }, | ||
106 | { "focus_follows_mouse", cmd_focus_follows_mouse }, | 107 | { "focus_follows_mouse", cmd_focus_follows_mouse }, |
107 | { "focus_wrapping", cmd_focus_wrapping }, | 108 | { "focus_wrapping", cmd_focus_wrapping }, |
108 | { "font", cmd_font }, | 109 | { "font", cmd_font }, |
@@ -137,7 +138,6 @@ static struct cmd_handler command_handlers[] = { | |||
137 | { "border", cmd_border }, | 138 | { "border", cmd_border }, |
138 | { "exit", cmd_exit }, | 139 | { "exit", cmd_exit }, |
139 | { "floating", cmd_floating }, | 140 | { "floating", cmd_floating }, |
140 | { "focus", cmd_focus }, | ||
141 | { "fullscreen", cmd_fullscreen }, | 141 | { "fullscreen", cmd_fullscreen }, |
142 | { "kill", cmd_kill }, | 142 | { "kill", cmd_kill }, |
143 | { "layout", cmd_layout }, | 143 | { "layout", cmd_layout }, |
diff --git a/sway/commands/focus.c b/sway/commands/focus.c index 2426a7f4..894025ad 100644 --- a/sway/commands/focus.c +++ b/sway/commands/focus.c | |||
@@ -84,6 +84,9 @@ static struct cmd_results *focus_output(struct sway_container *con, | |||
84 | } | 84 | } |
85 | 85 | ||
86 | struct cmd_results *cmd_focus(int argc, char **argv) { | 86 | struct cmd_results *cmd_focus(int argc, char **argv) { |
87 | if (config->reading || !config->active) { | ||
88 | return cmd_results_new(CMD_DEFER, NULL, NULL); | ||
89 | } | ||
87 | struct sway_container *con = config->handler_context.current_container; | 90 | struct sway_container *con = config->handler_context.current_container; |
88 | struct sway_seat *seat = config->handler_context.seat; | 91 | struct sway_seat *seat = config->handler_context.seat; |
89 | if (con->type < C_WORKSPACE) { | 92 | if (con->type < C_WORKSPACE) { |