diff options
author | Drew DeVault <sir@cmpwn.com> | 2015-12-25 10:13:22 -0700 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2015-12-25 10:13:22 -0700 |
commit | ed46fa7230e69ce07c9437fac9d9599c377e19bc (patch) | |
tree | 4e2806df4fd06bd6d27e366d4a7445243af7e4a7 | |
parent | Merge pull request #406 from mikkeloscar/fix-swaybar-json (diff) | |
parent | Trigger workspace init event (floating) (diff) | |
download | sway-ed46fa7230e69ce07c9437fac9d9599c377e19bc.tar.gz sway-ed46fa7230e69ce07c9437fac9d9599c377e19bc.tar.zst sway-ed46fa7230e69ce07c9437fac9d9599c377e19bc.zip |
Merge pull request #407 from mikkeloscar/trigger-on-move-floating
Trigger workspace init event (floating)
-rw-r--r-- | sway/layout.c | 9 |
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) { | |||
308 | swayc_t *parent = remove_child(container); | 308 | swayc_t *parent = remove_child(container); |
309 | // Send to new destination | 309 | // Send to new destination |
310 | if (container->is_floating) { | 310 | if (container->is_floating) { |
311 | add_floating(swayc_active_workspace_for(destination), container); | 311 | swayc_t *ws = swayc_active_workspace_for(destination); |
312 | add_floating(ws, container); | ||
313 | |||
314 | // If the workspace only has one child after adding one, it | ||
315 | // means that the workspace was just initialized. | ||
316 | if (ws->children->length + ws->floating->length == 1) { | ||
317 | ipc_event_workspace(NULL, ws, "init"); | ||
318 | } | ||
312 | } else if (destination->type == C_WORKSPACE) { | 319 | } else if (destination->type == C_WORKSPACE) { |
313 | // reset container geometry | 320 | // reset container geometry |
314 | container->width = container->height = 0; | 321 | container->width = container->height = 0; |