mirror of
https://github.com/swaywm/sway.git
synced 2024-11-29 11:21:28 +00:00
Fix workspaces not updated on swaybar
This commit is contained in:
parent
57954a2b24
commit
efac07db5f
|
@ -403,7 +403,6 @@ void container_move(struct sway_container *container,
|
||||||
int limit = container_limit(sibling, move_dir);
|
int limit = container_limit(sibling, move_dir);
|
||||||
wlr_log(L_DEBUG, "Reparenting container (paralell)");
|
wlr_log(L_DEBUG, "Reparenting container (paralell)");
|
||||||
limit = limit != 0 ? limit + 1 : limit; // Convert to index
|
limit = limit != 0 ? limit + 1 : limit; // Convert to index
|
||||||
wlr_log(L_DEBUG, "Reparenting container (paralell) %d", limit);
|
|
||||||
container_remove_child(container);
|
container_remove_child(container);
|
||||||
container_insert_child(sibling, container, limit);
|
container_insert_child(sibling, container, limit);
|
||||||
container->width = container->height = 0;
|
container->width = container->height = 0;
|
||||||
|
@ -431,6 +430,18 @@ void container_move(struct sway_container *container,
|
||||||
container_type_to_str(sibling->type));
|
container_type_to_str(sibling->type));
|
||||||
return;
|
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(
|
enum sway_container_layout container_get_default_layout(
|
||||||
|
|
|
@ -331,7 +331,7 @@ bool handle_ipc_readable(struct swaybar *bar) {
|
||||||
switch (resp->type) {
|
switch (resp->type) {
|
||||||
case IPC_EVENT_WORKSPACE:
|
case IPC_EVENT_WORKSPACE:
|
||||||
ipc_get_workspaces(bar);
|
ipc_get_workspaces(bar);
|
||||||
break;
|
return true;
|
||||||
case IPC_EVENT_MODE: {
|
case IPC_EVENT_MODE: {
|
||||||
json_object *result = json_tokener_parse(resp->payload);
|
json_object *result = json_tokener_parse(resp->payload);
|
||||||
if (!result) {
|
if (!result) {
|
||||||
|
|
Loading…
Reference in a new issue