diff options
author | emersion <contact@emersion.fr> | 2018-11-05 15:33:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-05 15:33:40 +0100 |
commit | d0bb450681588a9ea6d612de6893daace996873c (patch) | |
tree | bb71746de04a3d2e67218cc41812e885f82b929f | |
parent | Merge pull request #3067 from madblobfish/three-trivial-fixes (diff) | |
parent | gaps: Improve error reporting (diff) | |
download | sway-d0bb450681588a9ea6d612de6893daace996873c.tar.gz sway-d0bb450681588a9ea6d612de6893daace996873c.tar.zst sway-d0bb450681588a9ea6d612de6893daace996873c.zip |
Merge pull request #3066 from mwenzkowski/fix-gaps
Improvements to the runtime only part of the gaps command
-rw-r--r-- | sway/commands/gaps.c | 15 | ||||
-rw-r--r-- | sway/sway.5.scd | 8 |
2 files changed, 12 insertions, 11 deletions
diff --git a/sway/commands/gaps.c b/sway/commands/gaps.c index ca8cb27a..3f0ef155 100644 --- a/sway/commands/gaps.c +++ b/sway/commands/gaps.c | |||
@@ -149,16 +149,17 @@ struct cmd_results *cmd_gaps(int argc, char **argv) { | |||
149 | return error; | 149 | return error; |
150 | } | 150 | } |
151 | 151 | ||
152 | bool config_loading = !config->active || config->reloading; | ||
153 | |||
152 | if (argc == 2) { | 154 | if (argc == 2) { |
153 | return gaps_set_defaults(argc, argv); | 155 | return gaps_set_defaults(argc, argv); |
154 | } | 156 | } |
155 | if (argc == 4) { | 157 | if (argc == 4 && !config_loading) { |
156 | if (config->active) { | 158 | return gaps_set_runtime(argc, argv); |
157 | return gaps_set_runtime(argc, argv); | 159 | } |
158 | } else { | 160 | if (config_loading) { |
159 | return cmd_results_new(CMD_INVALID, "gaps", | 161 | return cmd_results_new(CMD_INVALID, "gaps", |
160 | "This syntax can only be used when sway is running"); | 162 | "Expected 'gaps inner|outer <px>'"); |
161 | } | ||
162 | } | 163 | } |
163 | return cmd_results_new(CMD_INVALID, "gaps", | 164 | return cmd_results_new(CMD_INVALID, "gaps", |
164 | "Expected 'gaps inner|outer <px>' or " | 165 | "Expected 'gaps inner|outer <px>' or " |
diff --git a/sway/sway.5.scd b/sway/sway.5.scd index f7ca00d6..4a645837 100644 --- a/sway/sway.5.scd +++ b/sway/sway.5.scd | |||
@@ -133,6 +133,10 @@ They are expected to be used with *bindsym* or at runtime through *swaymsg*(1). | |||
133 | *fullscreen* | 133 | *fullscreen* |
134 | Toggles fullscreen for the focused view. | 134 | Toggles fullscreen for the focused view. |
135 | 135 | ||
136 | *gaps* inner|outer all|current set|plus|minus <amount> | ||
137 | Changes the _inner_ or _outer_ gaps for either _all_ workspaces or the | ||
138 | _current_ workspace. | ||
139 | |||
136 | *layout* default|splith|splitv|stacking|tabbed | 140 | *layout* default|splith|splitv|stacking|tabbed |
137 | Sets the layout mode of the focused container. | 141 | Sets the layout mode of the focused container. |
138 | 142 | ||
@@ -434,10 +438,6 @@ The default colors are: | |||
434 | This affects new workspaces only, and is used when the workspace doesn't | 438 | This affects new workspaces only, and is used when the workspace doesn't |
435 | have its own gaps settings (see: workspace <ws> gaps inner|outer <amount>). | 439 | have its own gaps settings (see: workspace <ws> gaps inner|outer <amount>). |
436 | 440 | ||
437 | *gaps* inner|outer all|current set|plus|minus <amount> | ||
438 | Changes the _inner_ or _outer_ gaps for either _all_ workspaces or the | ||
439 | _current_ workspace. | ||
440 | |||
441 | *hide\_edge\_borders* none|vertical|horizontal|both|smart|smart\_no\_gaps | 441 | *hide\_edge\_borders* none|vertical|horizontal|both|smart|smart\_no\_gaps |
442 | Hides window borders adjacent to the screen edges. Default is _none_. | 442 | Hides window borders adjacent to the screen edges. Default is _none_. |
443 | 443 | ||