forked from external/yambar
parent
f2d25c8341
commit
89ae7bd743
1 changed files with 10 additions and 2 deletions
12
modules/i3.c
12
modules/i3.c
|
@ -418,10 +418,12 @@ handle_workspace_event(int sock, int type, const struct json_object *json, void
|
||||||
bool is_rename = strcmp(change_str, "rename") == 0;
|
bool is_rename = strcmp(change_str, "rename") == 0;
|
||||||
bool is_move = strcmp(change_str, "move") == 0;
|
bool is_move = strcmp(change_str, "move") == 0;
|
||||||
bool is_urgent = strcmp(change_str, "urgent") == 0;
|
bool is_urgent = strcmp(change_str, "urgent") == 0;
|
||||||
|
bool is_reload = strcmp(change_str, "reload") == 0;
|
||||||
|
|
||||||
struct json_object *current, *_current_id;
|
struct json_object *current, *_current_id;
|
||||||
if (!json_object_object_get_ex(json, "current", ¤t) ||
|
if ((!json_object_object_get_ex(json, "current", ¤t) ||
|
||||||
!json_object_object_get_ex(current, "id", &_current_id))
|
!json_object_object_get_ex(current, "id", &_current_id)) &&
|
||||||
|
!is_reload)
|
||||||
{
|
{
|
||||||
LOG_ERR("workspace event without 'current' and/or 'id' properties");
|
LOG_ERR("workspace event without 'current' and/or 'id' properties");
|
||||||
return false;
|
return false;
|
||||||
|
@ -543,6 +545,12 @@ handle_workspace_event(int sock, int type, const struct json_object *json, void
|
||||||
w->urgent = json_object_get_boolean(urgent);
|
w->urgent = json_object_get_boolean(urgent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if (is_reload) {
|
||||||
|
/* Schedule full update to check if anything was changed
|
||||||
|
* during reload */
|
||||||
|
i3_send_pkg(sock, I3_IPC_MESSAGE_TYPE_GET_WORKSPACES, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
LOG_WARN("unimplemented workspace event '%s'", change_str);
|
LOG_WARN("unimplemented workspace event '%s'", change_str);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue