aboutsummaryrefslogtreecommitdiffstats
path: root/sway/container.c
diff options
context:
space:
mode:
authorLibravatar Zandr Martin <zandrmartin@gmail.com>2016-09-21 21:05:09 -0500
committerLibravatar Zandr Martin <zandrmartin@gmail.com>2016-09-21 21:05:09 -0500
commit7d947fdb952c07c5dce5a0ae6b602f02cb274736 (patch)
tree22a573a8ff47672d32a74da1941bee2089167f5e /sway/container.c
parentMerge pull request #909 from zandrmartin/grab-focused (diff)
downloadsway-7d947fdb952c07c5dce5a0ae6b602f02cb274736.tar.gz
sway-7d947fdb952c07c5dce5a0ae6b602f02cb274736.tar.zst
sway-7d947fdb952c07c5dce5a0ae6b602f02cb274736.zip
add unique IDs to containers
Diffstat (limited to 'sway/container.c')
-rw-r--r--sway/container.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sway/container.c b/sway/container.c
index 561dcba6..73b627ec 100644
--- a/sway/container.c
+++ b/sway/container.c
@@ -18,8 +18,12 @@
18#define ASSERT_NONNULL(PTR) \ 18#define ASSERT_NONNULL(PTR) \
19 sway_assert (PTR, #PTR "must be non-null") 19 sway_assert (PTR, #PTR "must be non-null")
20 20
21
21static swayc_t *new_swayc(enum swayc_types type) { 22static swayc_t *new_swayc(enum swayc_types type) {
23 // next id starts at 1 because 0 is assigned to root_container in layout.c
24 static size_t next_id = 1;
22 swayc_t *c = calloc(1, sizeof(swayc_t)); 25 swayc_t *c = calloc(1, sizeof(swayc_t));
26 c->id = next_id++;
23 c->handle = -1; 27 c->handle = -1;
24 c->gaps = -1; 28 c->gaps = -1;
25 c->layout = L_NONE; 29 c->layout = L_NONE;