aboutsummaryrefslogtreecommitdiffstats
path: root/sway/ipc-json.c
diff options
context:
space:
mode:
authorLibravatar Mykyta Holubakha <hilobakho@gmail.com>2016-07-21 21:51:09 +0300
committerLibravatar Mykyta Holubakha <hilobakho@gmail.com>2016-07-21 21:53:36 +0300
commitf022628a2ef56ea296232b8e7bd7b73a6ce0df63 (patch)
tree96929d8f1b16ad0b5773b1776484caba858c77a5 /sway/ipc-json.c
parentUnite describe_view and describe_window (diff)
downloadsway-f022628a2ef56ea296232b8e7bd7b73a6ce0df63.tar.gz
sway-f022628a2ef56ea296232b8e7bd7b73a6ce0df63.tar.zst
sway-f022628a2ef56ea296232b8e7bd7b73a6ce0df63.zip
Handle transient_for
Diffstat (limited to 'sway/ipc-json.c')
-rw-r--r--sway/ipc-json.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sway/ipc-json.c b/sway/ipc-json.c
index f893aabf..4e5ea896 100644
--- a/sway/ipc-json.c
+++ b/sway/ipc-json.c
@@ -150,6 +150,7 @@ static void ipc_json_describe_view(swayc_t *c, json_object *object) {
150 ipc_json_layout_description(c->parent->layout) : "none"; 150 ipc_json_layout_description(c->parent->layout) : "none";
151 const char *last_layout = (c->parent->type == C_CONTAINER) ? 151 const char *last_layout = (c->parent->type == C_CONTAINER) ?
152 ipc_json_layout_description(c->parent->prev_layout) : "none"; 152 ipc_json_layout_description(c->parent->prev_layout) : "none";
153 wlc_handle parent = wlc_view_get_parent(c->handle);
153 154
154 json_object_object_add(object, "id", json_object_new_int(c->handle)); 155 json_object_object_add(object, "id", json_object_new_int(c->handle));
155 json_object_object_add(object, "type", json_object_new_string((c->is_floating) ? "floating_con" : "con")); 156 json_object_object_add(object, "type", json_object_new_string((c->is_floating) ? "floating_con" : "con"));
@@ -174,7 +175,7 @@ static void ipc_json_describe_view(swayc_t *c, json_object *object) {
174 json_object_object_add(object, "rect", ipc_json_create_rect(c)); 175 json_object_object_add(object, "rect", ipc_json_create_rect(c));
175 json_object_object_add(object, "deco_rect", ipc_json_create_rect_from_geometry(c->title_bar_geometry)); 176 json_object_object_add(object, "deco_rect", ipc_json_create_rect_from_geometry(c->title_bar_geometry));
176 json_object_object_add(object, "geometry", ipc_json_create_rect_from_geometry(c->cached_geometry)); 177 json_object_object_add(object, "geometry", ipc_json_create_rect_from_geometry(c->cached_geometry));
177 json_object_object_add(object, "window_rect", ipc_json_create_rect_from_geometry(c->actual_geometry)); //? 178 json_object_object_add(object, "window_rect", ipc_json_create_rect_from_geometry(c->actual_geometry));
178 179
179 json_object_object_add(object, "name", (c->name) ? json_object_new_string(c->name) : NULL); 180 json_object_object_add(object, "name", (c->name) ? json_object_new_string(c->name) : NULL);
180 181
@@ -182,17 +183,17 @@ static void ipc_json_describe_view(swayc_t *c, json_object *object) {
182 json_object_object_add(props, "class", c->class ? json_object_new_string(c->class) : 183 json_object_object_add(props, "class", c->class ? json_object_new_string(c->class) :
183 c->app_id ? json_object_new_string(c->app_id) : NULL); 184 c->app_id ? json_object_new_string(c->app_id) : NULL);
184 json_object_object_add(props, "title", (c->name) ? json_object_new_string(c->name) : NULL); 185 json_object_object_add(props, "title", (c->name) ? json_object_new_string(c->name) : NULL);
185 json_object_object_add(props, "transient_for", NULL); // unless sway keeps track of child views 186 json_object_object_add(props, "transient_for", parent ? json_object_new_int(parent) : NULL);
186 json_object_object_add(object, "window_properties", props); 187 json_object_object_add(object, "window_properties", props);
187 188
188 json_object_object_add(object, "fullscreen_mode", 189 json_object_object_add(object, "fullscreen_mode",
189 json_object_new_int(swayc_is_fullscreen(c) ? 1 : 0)); 190 json_object_new_int(swayc_is_fullscreen(c) ? 1 : 0));
190 json_object_object_add(object, "sticky", json_object_new_boolean(c->sticky)); 191 json_object_object_add(object, "sticky", json_object_new_boolean(c->sticky));
191 json_object_object_add(object, "floating", json_object_new_string( 192 json_object_object_add(object, "floating", json_object_new_string(
192 c->is_floating ? "auto_on" : "auto_off")); // unless relevant info is saved 193 c->is_floating ? "auto_on" : "auto_off")); // we can't state the cause
193 194
194 json_object_object_add(object, "app_id", c->app_id ? json_object_new_string(c->app_id) : NULL); 195 json_object_object_add(object, "app_id", c->app_id ? json_object_new_string(c->app_id) : NULL);
195 // we do not include children, floating, unmanaged etc. as views seem to have none 196 // we do not include children, floating, unmanaged etc. as views have none
196} 197}
197 198
198json_object *ipc_json_describe_container(swayc_t *c) { 199json_object *ipc_json_describe_container(swayc_t *c) {