aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2018-04-05 23:05:43 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2018-04-06 09:43:52 -0400
commitefac07db5fc066dd8f6d5e0dda63b463d13de0d6 (patch)
tree5a1de3dbc415c968dd3146d9337379b278502daf
parentImplement move [left|right|up|down] (diff)
downloadsway-efac07db5fc066dd8f6d5e0dda63b463d13de0d6.tar.gz
sway-efac07db5fc066dd8f6d5e0dda63b463d13de0d6.tar.zst
sway-efac07db5fc066dd8f6d5e0dda63b463d13de0d6.zip
Fix workspaces not updated on swaybar
-rw-r--r--sway/tree/layout.c13
-rw-r--r--swaybar/ipc.c2
2 files changed, 13 insertions, 2 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,
403 int limit = container_limit(sibling, move_dir); 403 int limit = container_limit(sibling, move_dir);
404 wlr_log(L_DEBUG, "Reparenting container (paralell)"); 404 wlr_log(L_DEBUG, "Reparenting container (paralell)");
405 limit = limit != 0 ? limit + 1 : limit; // Convert to index 405 limit = limit != 0 ? limit + 1 : limit; // Convert to index
406 wlr_log(L_DEBUG, "Reparenting container (paralell) %d", limit);
407 container_remove_child(container); 406 container_remove_child(container);
408 container_insert_child(sibling, container, limit); 407 container_insert_child(sibling, container, limit);
409 container->width = container->height = 0; 408 container->width = container->height = 0;
@@ -431,6 +430,18 @@ void container_move(struct sway_container *container,
431 container_type_to_str(sibling->type)); 430 container_type_to_str(sibling->type));
432 return; 431 return;
433 } 432 }
433
434 struct sway_container *last_ws = old_parent;
435 struct sway_container *next_ws = container->parent;
436 if (last_ws && last_ws->type != C_WORKSPACE) {
437 last_ws = container_parent(last_ws, C_WORKSPACE);
438 }
439 if (next_ws && next_ws->type != C_WORKSPACE) {
440 next_ws = container_parent(next_ws, C_WORKSPACE);
441 }
442 if (last_ws && next_ws && last_ws != next_ws) {
443 ipc_event_workspace(last_ws, container, "focus");
444 }
434} 445}
435 446
436enum sway_container_layout container_get_default_layout( 447enum sway_container_layout container_get_default_layout(
diff --git a/swaybar/ipc.c b/swaybar/ipc.c
index 92dbb8ea..e6231bd2 100644
--- a/swaybar/ipc.c
+++ b/swaybar/ipc.c
@@ -331,7 +331,7 @@ bool handle_ipc_readable(struct swaybar *bar) {
331 switch (resp->type) { 331 switch (resp->type) {
332 case IPC_EVENT_WORKSPACE: 332 case IPC_EVENT_WORKSPACE:
333 ipc_get_workspaces(bar); 333 ipc_get_workspaces(bar);
334 break; 334 return true;
335 case IPC_EVENT_MODE: { 335 case IPC_EVENT_MODE: {
336 json_object *result = json_tokener_parse(resp->payload); 336 json_object *result = json_tokener_parse(resp->payload);
337 if (!result) { 337 if (!result) {