summaryrefslogtreecommitdiff
path: root/sway/container.c
diff options
context:
space:
mode:
authorDrew DeVault <[email protected]>2015-09-06 10:13:33 -0400
committerDrew DeVault <[email protected]>2015-09-06 10:13:33 -0400
commitbb51122f3d8f58871cdec707c70001967d6ced09 (patch)
tree77aa4aba2b690f06308ee676989be39fb9852f70 /sway/container.c
parent7169ebc24cb61ba7443d6c69e52b378907a3d4b7 (diff)
parent3e9cdfd6a3bcb696ed15968c949a6f6fd7dae394 (diff)
Merge pull request #171 from taiyu-len/master
resize gap
Diffstat (limited to 'sway/container.c')
-rw-r--r--sway/container.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/sway/container.c b/sway/container.c
index c922a6e6..ef0e6c55 100644
--- a/sway/container.c
+++ b/sway/container.c
@@ -653,15 +653,24 @@ void update_visibility(swayc_t *container) {
}
}
-void reset_gaps(swayc_t *view, void *data) {
- (void) data;
+void set_gaps(swayc_t *view, void *_data) {
+ int *data = _data;
if (!ASSERT_NONNULL(view)) {
return;
}
- if (view->type == C_WORKSPACE) {
- view->gaps = -1;
+ if (view->type == C_WORKSPACE || view->type == C_VIEW) {
+ view->gaps = *data;
}
- if (view->type == C_VIEW) {
- view->gaps = -1;
+}
+
+void add_gaps(swayc_t *view, void *_data) {
+ int *data = _data;
+ if (!ASSERT_NONNULL(view)) {
+ return;
+ }
+ if (view->type == C_WORKSPACE || view->type == C_VIEW) {
+ if ((view->gaps += *data) < 0) {
+ view->gaps = 0;
+ }
}
}