Merge pull request #3894 from Iskustvo/extend_GET_WORKSPACES_response
Extended GET_WORKSPACE response with workspace ID.
This commit is contained in:
commit
dab223cabc
4
docs/ipc
4
docs/ipc
|
@ -164,6 +164,10 @@ sending a reply. Expect the socket to be shut down.
|
||||||
The reply consists of a serialized list of workspaces. Each workspace has the
|
The reply consists of a serialized list of workspaces. Each workspace has the
|
||||||
following properties:
|
following properties:
|
||||||
|
|
||||||
|
id (integer)::
|
||||||
|
The internal ID (actually a C pointer value) of this container. Do not
|
||||||
|
make any assumptions about it. You can use it to (re-)identify and
|
||||||
|
address containers when talking to i3.
|
||||||
num (integer)::
|
num (integer)::
|
||||||
The logical number of the workspace. Corresponds to the command
|
The logical number of the workspace. Corresponds to the command
|
||||||
to switch to this workspace. For named workspaces, this will be -1.
|
to switch to this workspace. For named workspaces, this will be -1.
|
||||||
|
|
|
@ -30,6 +30,7 @@ void parse_workspaces_json(char *json);
|
||||||
void free_workspaces(void);
|
void free_workspaces(void);
|
||||||
|
|
||||||
struct i3_ws {
|
struct i3_ws {
|
||||||
|
uintptr_t id; /* Workspace ID - C pointer to a workspace container */
|
||||||
int num; /* The internal number of the ws */
|
int num; /* The internal number of the ws */
|
||||||
char *canonical_name; /* The true name of the ws according to the ipc */
|
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 */
|
i3String *name; /* The name of the ws that is displayed on the bar */
|
||||||
|
|
|
@ -61,6 +61,12 @@ static int workspaces_boolean_cb(void *params_, int val) {
|
||||||
static int workspaces_integer_cb(void *params_, long long val) {
|
static int workspaces_integer_cb(void *params_, long long val) {
|
||||||
struct workspaces_json_params *params = (struct workspaces_json_params *)params_;
|
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")) {
|
if (!strcmp(params->cur_key, "num")) {
|
||||||
params->workspaces_walk->num = (int)val;
|
params->workspaces_walk->num = (int)val;
|
||||||
FREE(params->cur_key);
|
FREE(params->cur_key);
|
||||||
|
|
Loading…
Reference in New Issue