diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-09-29 11:06:07 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-09-29 11:08:19 +1000 |
commit | 415a48ac6387a62a59adb8ed1168e851509a0ce3 (patch) | |
tree | fd0027a67439414e164318182be29a3529805543 /include/sway | |
parent | dc01e884f7d71435015dd3e61f0e269a88975d8a (diff) |
Make gaps implementation consistent with i3-gaps
This changes our gaps implementation to behave like i3-gaps.
Our previous implementation allowed you to set gaps on a per container
basis. This isn't supported by i3-gaps and doesn't seem to have a
practical use case. The gaps_outer and gaps_inner properties on
containers are now removed as they just read the gaps_inner from the
workspace.
`gaps inner|outer <px>` no longer changes the gaps for all workspaces.
It only sets defaults for new workspaces.
`gaps inner|outer current|workspace|all set|plus|minus <px>` is now
runtime only, and the workspace option is now removed. `current` now
sets gaps for the current workspace as opposed to the current container.
`workspace <ws> gaps inner|outer <px>` is now implemented. This sets
defaults for a workspace.
This also fixes a bug where changing the layout of a split container
from linear to tabbed would cause gaps to not be applied to it until you
switch to another workspace and back.
Diffstat (limited to 'include/sway')
-rw-r--r-- | include/sway/config.h | 2 | ||||
-rw-r--r-- | include/sway/tree/container.h | 3 | ||||
-rw-r--r-- | include/sway/tree/workspace.h | 7 |
3 files changed, 5 insertions, 7 deletions
diff --git a/include/sway/config.h b/include/sway/config.h index af5c7a18..82be26ca 100644 --- a/include/sway/config.h +++ b/include/sway/config.h @@ -173,6 +173,8 @@ struct output_config { struct workspace_config { char *workspace; char *output; + int gaps_inner; + int gaps_outer; }; struct bar_config { diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h index 5e281a2f..b865a0f2 100644 --- a/include/sway/tree/container.h +++ b/include/sway/tree/container.h @@ -94,9 +94,6 @@ struct sway_container { // The gaps currently applied to the container. double current_gaps; - bool has_gaps; - double gaps_inner; - double gaps_outer; struct sway_workspace *workspace; // NULL when hidden in the scratchpad struct sway_container *parent; // NULL if container in root of workspace diff --git a/include/sway/tree/workspace.h b/include/sway/tree/workspace.h index c8220b39..efdae5a1 100644 --- a/include/sway/tree/workspace.h +++ b/include/sway/tree/workspace.h @@ -32,10 +32,9 @@ struct sway_workspace { enum sway_container_layout layout; enum sway_container_layout prev_split_layout; - double current_gaps; - bool has_gaps; - double gaps_inner; - double gaps_outer; + int current_gaps; + int gaps_inner; + int gaps_outer; struct sway_output *output; // NULL if no outputs are connected list_t *floating; // struct sway_container |