aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2015-12-25 10:13:22 -0700
committerDrew DeVault <sir@cmpwn.com>2015-12-25 10:13:22 -0700
commited46fa7230e69ce07c9437fac9d9599c377e19bc (patch)
tree4e2806df4fd06bd6d27e366d4a7445243af7e4a7
parent3bcb3b332dd38bba15cf6c1f388f8aad94df077f (diff)
parent5d07c613303453af273b1937fbc1cd61b1516046 (diff)
Merge pull request #407 from mikkeloscar/trigger-on-move-floating
Trigger workspace init event (floating)
-rw-r--r--sway/layout.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sway/layout.c b/sway/layout.c
index 563e9d11..d32f3dd0 100644
--- a/sway/layout.c
+++ b/sway/layout.c
@@ -308,7 +308,14 @@ void move_container_to(swayc_t* container, swayc_t* destination) {
swayc_t *parent = remove_child(container);
// Send to new destination
if (container->is_floating) {
- add_floating(swayc_active_workspace_for(destination), container);
+ swayc_t *ws = swayc_active_workspace_for(destination);
+ add_floating(ws, container);
+
+ // If the workspace only has one child after adding one, it
+ // means that the workspace was just initialized.
+ if (ws->children->length + ws->floating->length == 1) {
+ ipc_event_workspace(NULL, ws, "init");
+ }
} else if (destination->type == C_WORKSPACE) {
// reset container geometry
container->width = container->height = 0;