diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-04-05 23:05:43 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2018-04-06 09:43:52 -0400 |
commit | efac07db5fc066dd8f6d5e0dda63b463d13de0d6 (patch) | |
tree | 5a1de3dbc415c968dd3146d9337379b278502daf /sway | |
parent | 57954a2b24f1e211c3b8811fb898ef4e076cb098 (diff) |
Fix workspaces not updated on swaybar
Diffstat (limited to 'sway')
-rw-r--r-- | sway/tree/layout.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sway/tree/layout.c b/sway/tree/layout.c index a060cb85..e91fd5ac 100644 --- a/sway/tree/layout.c +++ b/sway/tree/layout.c @@ -403,7 +403,6 @@ void container_move(struct sway_container *container, int limit = container_limit(sibling, move_dir); wlr_log(L_DEBUG, "Reparenting container (paralell)"); limit = limit != 0 ? limit + 1 : limit; // Convert to index - wlr_log(L_DEBUG, "Reparenting container (paralell) %d", limit); container_remove_child(container); container_insert_child(sibling, container, limit); container->width = container->height = 0; @@ -431,6 +430,18 @@ void container_move(struct sway_container *container, container_type_to_str(sibling->type)); return; } + + struct sway_container *last_ws = old_parent; + struct sway_container *next_ws = container->parent; + if (last_ws && last_ws->type != C_WORKSPACE) { + last_ws = container_parent(last_ws, C_WORKSPACE); + } + if (next_ws && next_ws->type != C_WORKSPACE) { + next_ws = container_parent(next_ws, C_WORKSPACE); + } + if (last_ws && next_ws && last_ws != next_ws) { + ipc_event_workspace(last_ws, container, "focus"); + } } enum sway_container_layout container_get_default_layout( |