Added workspace ID in GET_WORKSPACES response.

This commit is contained in:
Iskustvo
2020-01-07 02:32:18 +01:00
parent d341b91b0a
commit 5835bbc385
4 changed files with 14 additions and 0 deletions

View File

@ -30,6 +30,7 @@ void parse_workspaces_json(char *json);
void free_workspaces(void);
struct i3_ws {
uintptr_t id; /* Workspace ID - C pointer to a workspace container */
int num; /* The internal number of the ws */
char *canonical_name; /* The true name of the ws according to the ipc */
i3String *name; /* The name of the ws that is displayed on the bar */

View File

@ -61,6 +61,12 @@ static int workspaces_boolean_cb(void *params_, int val) {
static int workspaces_integer_cb(void *params_, long long val) {
struct workspaces_json_params *params = (struct workspaces_json_params *)params_;
if (!strcmp(params->cur_key, "id")) {
params->workspaces_walk->id = val;
FREE(params->cur_key);
return 1;
}
if (!strcmp(params->cur_key, "num")) {
params->workspaces_walk->num = (int)val;
FREE(params->cur_key);