aboutsummaryrefslogtreecommitdiffstats
path: root/include/sway/config.h
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 /include/sway/config.h
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 'include/sway/config.h')
-rw-r--r--include/sway/config.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/include/sway/config.h b/include/sway/config.h
index 0912bc73..cd56c3dc 100644
--- a/include/sway/config.h
+++ b/include/sway/config.h
@@ -168,6 +168,16 @@ struct output_config {
168}; 168};
169 169
170/** 170/**
171 * Stores size of gaps for each side
172 */
173struct side_gaps {
174 int top;
175 int right;
176 int bottom;
177 int left;
178};
179
180/**
171 * Stores configuration for a workspace, regardless of whether the workspace 181 * Stores configuration for a workspace, regardless of whether the workspace
172 * exists. 182 * exists.
173 */ 183 */
@@ -175,7 +185,7 @@ struct workspace_config {
175 char *workspace; 185 char *workspace;
176 char *output; 186 char *output;
177 int gaps_inner; 187 int gaps_inner;
178 int gaps_outer; 188 struct side_gaps gaps_outer;
179}; 189};
180 190
181struct bar_config { 191struct bar_config {
@@ -398,7 +408,7 @@ struct sway_config {
398 408
399 bool smart_gaps; 409 bool smart_gaps;
400 int gaps_inner; 410 int gaps_inner;
401 int gaps_outer; 411 struct side_gaps gaps_outer;
402 412
403 list_t *config_chain; 413 list_t *config_chain;
404 const char *current_config_path; 414 const char *current_config_path;