mirror of
https://github.com/swaywm/sway.git
synced 2025-11-10 13:29:51 -05:00
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.
This commit is contained in:
parent
442a54c38b
commit
50b04884b6
4 changed files with 31 additions and 15 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue