diff options
author | Mikkel Oscar Lyderik <mikkeloscar@gmail.com> | 2015-12-21 22:01:36 +0100 |
---|---|---|
committer | Mikkel Oscar Lyderik <mikkeloscar@gmail.com> | 2015-12-21 23:07:52 +0100 |
commit | 50b04884b65b7e04234e8fa794a4e6db48c133a4 (patch) | |
tree | ebf8c63bfb812a5d8bd7ab455a5b68ef81054dd2 /sway/layout.c | |
parent | Merge pull request #390 from mikkeloscar/workspace-ipc-event (diff) | |
download | sway-50b04884b65b7e04234e8fa794a4e6db48c133a4.tar.gz sway-50b04884b65b7e04234e8fa794a4e6db48c133a4.tar.zst sway-50b04884b65b7e04234e8fa794a4e6db48c133a4.zip |
Trigger ipc_event_workspace in all cases
This makes sure that the workspace IPC event is triggered when needed.
Fixes #382 while making sure that the IPC event is only triggered once.
Diffstat (limited to 'sway/layout.c')
-rw-r--r-- | sway/layout.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sway/layout.c b/sway/layout.c index a9e7c7f1..563e9d11 100644 --- a/sway/layout.c +++ b/sway/layout.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include "workspace.h" | 10 | #include "workspace.h" |
11 | #include "focus.h" | 11 | #include "focus.h" |
12 | #include "output.h" | 12 | #include "output.h" |
13 | #include "ipc-server.h" | ||
13 | 14 | ||
14 | swayc_t root_container; | 15 | swayc_t root_container; |
15 | list_t *scratchpad; | 16 | list_t *scratchpad; |
@@ -312,6 +313,12 @@ void move_container_to(swayc_t* container, swayc_t* destination) { | |||
312 | // reset container geometry | 313 | // reset container geometry |
313 | container->width = container->height = 0; | 314 | container->width = container->height = 0; |
314 | add_child(destination, container); | 315 | add_child(destination, container); |
316 | |||
317 | // If the workspace only has one child after adding one, it | ||
318 | // means that the workspace was just initialized. | ||
319 | if (destination->children->length + destination->floating->length == 1) { | ||
320 | ipc_event_workspace(NULL, destination, "init"); | ||
321 | } | ||
315 | } else { | 322 | } else { |
316 | // reset container geometry | 323 | // reset container geometry |
317 | container->width = container->height = 0; | 324 | container->width = container->height = 0; |