summaryrefslogtreecommitdiffstats
path: root/sway/layout.c
diff options
context:
space:
mode:
authorLibravatar Mikkel Oscar Lyderik <mikkeloscar@gmail.com>2015-12-25 18:02:12 +0100
committerLibravatar Mikkel Oscar Lyderik <mikkeloscar@gmail.com>2015-12-25 18:02:12 +0100
commit5d07c613303453af273b1937fbc1cd61b1516046 (patch)
tree4e2806df4fd06bd6d27e366d4a7445243af7e4a7 /sway/layout.c
parentMerge pull request #406 from mikkeloscar/fix-swaybar-json (diff)
downloadsway-5d07c613303453af273b1937fbc1cd61b1516046.tar.gz
sway-5d07c613303453af273b1937fbc1cd61b1516046.tar.zst
sway-5d07c613303453af273b1937fbc1cd61b1516046.zip
Trigger workspace init event (floating)
Triggers workspace init event when moving a floating window to a new workspace. This is a follow up on #391 which didn't handle floating windows.
Diffstat (limited to 'sway/layout.c')
-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) {
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;