Root Tree State does not update
See original GitHub issuePreface: I’m not sure if this is an issue with the IPC or a feature of i3 itself but a confirmation would be nice.
If you change the attributes of a window in another workspace, the new attributes are not reflected in get_tree
until that window has received focus.
Ex:
1.) Create a window in workspace 1 2.) Go to Workspace 2 3.) Open & run command in terminal 1 python shell (leave shell open)
from i3ipc import Connection
i3 = Connection()
rect = i3.get_tree().find_by_id(<id_of_wkspc1_window>).rect
print(rect.__dict__)
4.) Open & run command in terminal 2 in bash shell
i3-msg [con_id=<id_of_wkspc1_window>] resize set 75ppt 75ppt
5.) Still in workspace 2, run in terminal 1 in the same python shell
rect = i3.get_tree().find_by_id(<id_of_wkspc1_window>).rect
print(rect.__dict__)
The rect
still contains the same values, even though it has been manipulated. If you now focus on workspace 1, go back to workspace 2 and rerun the same python command:
rect = i3.get_tree().find_by_id(<id_of_wkspc1_window>).rect
print(rect.__dict__)
The height and width attributes of rect
are now changed… I am thinking this might be a lazy evaluation by i3 itself rather than an issue with the IPC. But maybe I am incorrect.
I have also tried reinstantiating a new Connection
instance with every run to no avail.
Any advice here would be great. Thank you!
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
I think this test illustrates the problem
https://github.com/altdesktop/i3ipc-python/blob/0ec537d405f5327b86aee09bbdb0986dc136ff8f/test/aio/test_window.py#L76-L102
It’s very likely an issue with i3 because all the tree info is rerendered every time you call
get_tree()
with what the ipc gives us.Try to reproduce the issue with
i3-msg -t get_tree
alone. If you do that, you can post it on the i3 tracker and it can get fixed there.