question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Root Tree State does not update

See original GitHub issue

Preface: 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:open
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
acriscicommented, Oct 31, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found