diff options
author | llyyr <llyyr@yukari.in> | 2024-02-27 02:06:27 +0530 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2024-02-29 00:51:43 +0100 |
commit | 0b84d82b9aad05010479140774ac5ee1fea8ea97 (patch) | |
tree | 1265eda82806b43ec1b294110af82bbc62476461 | |
parent | ipc: add `floating` property to GET_TREE (diff) | |
download | sway-0b84d82b9aad05010479140774ac5ee1fea8ea97.tar.gz sway-0b84d82b9aad05010479140774ac5ee1fea8ea97.tar.zst sway-0b84d82b9aad05010479140774ac5ee1fea8ea97.zip |
ipc: add `scratchpad_state` property to GET_TREE
See previous commit. This restores ipc parity with i3.
-rw-r--r-- | sway/ipc-json.c | 5 | ||||
-rw-r--r-- | sway/sway-ipc.7.scd | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/sway/ipc-json.c b/sway/ipc-json.c index 84e164e4..dfbb7a6e 100644 --- a/sway/ipc-json.c +++ b/sway/ipc-json.c | |||
@@ -289,6 +289,7 @@ static json_object *ipc_json_create_node(int id, const char* type, char *name, | |||
289 | json_object_object_add(object, "fullscreen_mode", json_object_new_int(0)); | 289 | json_object_object_add(object, "fullscreen_mode", json_object_new_int(0)); |
290 | json_object_object_add(object, "sticky", json_object_new_boolean(false)); | 290 | json_object_object_add(object, "sticky", json_object_new_boolean(false)); |
291 | json_object_object_add(object, "floating", NULL); | 291 | json_object_object_add(object, "floating", NULL); |
292 | json_object_object_add(object, "scratchpad_state", NULL); | ||
292 | 293 | ||
293 | return object; | 294 | return object; |
294 | } | 295 | } |
@@ -702,6 +703,10 @@ static void ipc_json_describe_container(struct sway_container *c, json_object *o | |||
702 | json_object_object_add(object, "fullscreen_mode", | 703 | json_object_object_add(object, "fullscreen_mode", |
703 | json_object_new_int(c->pending.fullscreen_mode)); | 704 | json_object_new_int(c->pending.fullscreen_mode)); |
704 | 705 | ||
706 | // sway doesn't track if window was resized in scratchpad, so we can't use "changed" | ||
707 | json_object_object_add(object, "scratchpad_state", | ||
708 | json_object_new_string(!c->scratchpad ? "none" : "fresh")); | ||
709 | |||
705 | struct sway_node *parent = node_get_parent(&c->node); | 710 | struct sway_node *parent = node_get_parent(&c->node); |
706 | struct wlr_box parent_box = {0, 0, 0, 0}; | 711 | struct wlr_box parent_box = {0, 0, 0, 0}; |
707 | 712 | ||
diff --git a/sway/sway-ipc.7.scd b/sway/sway-ipc.7.scd index 5859558f..c9895e52 100644 --- a/sway/sway-ipc.7.scd +++ b/sway/sway-ipc.7.scd | |||
@@ -379,6 +379,9 @@ node and will have the following properties: | |||
379 | |- floating | 379 | |- floating |
380 | : string | 380 | : string |
381 | : Floating state of container. Can be either "auto_off" or "user_on" | 381 | : Floating state of container. Can be either "auto_off" or "user_on" |
382 | |- scratchpad_state | ||
383 | : string | ||
384 | : Whether the window is in the scratchpad. Can be either "none" or "fresh" | ||
382 | |- app_id | 385 | |- app_id |
383 | : string | 386 | : string |
384 | : (Only views) For an xdg-shell view, the name of the application, if set. | 387 | : (Only views) For an xdg-shell view, the name of the application, if set. |