aboutsummaryrefslogtreecommitdiffstats
path: root/sway/config.c
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2018-11-07 22:44:11 -0500
committerLibravatar Brian Ashworth <bosrsf04@gmail.com>2018-11-07 22:44:11 -0500
commit9e8aa3953098adb6175c26aebd984a32a2beccb0 (patch)
treeac64adf9f2720ddbb2476810f6ec05ec2a85a4ae /sway/config.c
parentAdd focus_follows_mouse always. (#3081) (diff)
downloadsway-9e8aa3953098adb6175c26aebd984a32a2beccb0.tar.gz
sway-9e8aa3953098adb6175c26aebd984a32a2beccb0.tar.zst
sway-9e8aa3953098adb6175c26aebd984a32a2beccb0.zip
Implement per side and per direction outer gaps
This introduces the following command extensions from `i3-gaps`: * `gaps horizontal|vertical|top|right|bottom|left <amount>` * `gaps horizontal|vertical|top|right|bottom|left all|current set|plus|minus <amount>` * `workspace <ws> gaps horizontal|vertical|top|right|bottom|left <amount>` `inner` and `outer` are also still available as options for all three of the above commands. `outer` now acts as a shorthand to set/alter all sides. Additionally, this fixes two bugs with the prevention of invalid gap configurations for workspace configs: 1. If outer gaps were not set and inner gaps were, the outer gaps would be snapped to the negation of the inner gaps due to `INT_MIN` being less than the negation. This took precedence over the default outer gaps. 2. Similarly, if inner gaps were not set and outer gaps were, inner gaps would be set to zero, which would take precedence over the default inner gaps. Fixing both of the above items also requires checking the gaps again when creating a workspace since the default outer gaps can be smaller than the negation of the workspace specific inner gaps.
Diffstat (limited to 'sway/config.c')
-rw-r--r--sway/config.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sway/config.c b/sway/config.c
index 64653024..0fdd1723 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -234,7 +234,10 @@ static void config_defaults(struct sway_config *config) {
234 234
235 config->smart_gaps = false; 235 config->smart_gaps = false;
236 config->gaps_inner = 0; 236 config->gaps_inner = 0;
237 config->gaps_outer = 0; 237 config->gaps_outer.top = 0;
238 config->gaps_outer.right = 0;
239 config->gaps_outer.bottom = 0;
240 config->gaps_outer.left = 0;
238 241
239 if (!(config->active_bar_modifiers = create_list())) goto cleanup; 242 if (!(config->active_bar_modifiers = create_list())) goto cleanup;
240 243