aboutsummaryrefslogtreecommitdiff
path: root/sway/layout.c
diff options
context:
space:
mode:
authorMikkel Oscar Lyderik <mikkeloscar@gmail.com>2015-12-21 22:01:36 +0100
committerMikkel Oscar Lyderik <mikkeloscar@gmail.com>2015-12-21 23:07:52 +0100
commit50b04884b65b7e04234e8fa794a4e6db48c133a4 (patch)
treeebf8c63bfb812a5d8bd7ab455a5b68ef81054dd2 /sway/layout.c
parent442a54c38bb60d92bd4383f0d80ca55b876399e8 (diff)
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.c7
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 @@
#include "workspace.h"
#include "focus.h"
#include "output.h"
+#include "ipc-server.h"
swayc_t root_container;
list_t *scratchpad;
@@ -312,6 +313,12 @@ void move_container_to(swayc_t* container, swayc_t* destination) {
// reset container geometry
container->width = container->height = 0;
add_child(destination, container);
+
+ // If the workspace only has one child after adding one, it
+ // means that the workspace was just initialized.
+ if (destination->children->length + destination->floating->length == 1) {
+ ipc_event_workspace(NULL, destination, "init");
+ }
} else {
// reset container geometry
container->width = container->height = 0;