Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions sway/ipc-json.c
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,8 @@ static void ipc_json_describe_view(struct sway_container *c, json_object *object

struct wlr_box geometry = {0, 0, c->view->natural_width, c->view->natural_height};
json_object_object_add(object, "geometry", ipc_json_create_rect(&geometry));
json_object_object_add(
object, "surface_content_rect", ipc_json_create_rect(&c->view->geometry));

json_object_object_add(object, "max_render_time", json_object_new_int(c->view->max_render_time));

Expand Down
4 changes: 4 additions & 0 deletions sway/scroll-ipc.7.scd
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,10 @@ node and will have the following properties:
|- geometry
: object
: The natural geometry of the contents if it were to size itself
|- surface_content_rect
: object
: (Only windows) The geometry of the view content relative to its surface.
This includes _x_, _y_, _width_, and _height_.
|- urgent
: boolean
: Whether the node or any of its descendants has the urgent hint set. Note:
Expand Down
7 changes: 7 additions & 0 deletions tests/test_geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ def find_node(node, target_id):

target_node = find_node(tree, con_id)
assert target_node is not None
assert "surface_content_rect" in target_node
view_geom = target_node["surface_content_rect"]
assert "x" in view_geom
assert "y" in view_geom
assert "width" in view_geom
assert "height" in view_geom

rect = target_node["rect"]
deco_rect = target_node.get("deco_rect", {"height": 0})

Expand Down