diff options
author | Orestis Floros <orestisflo@gmail.com> | 2021-11-11 20:14:22 +0100 |
---|---|---|
committer | Orestis Floros <orestisflo@gmail.com> | 2021-11-11 20:29:02 +0100 |
commit | e1d3e6b2f6c721c03022e4f80a9844f189d1862c (patch) | |
tree | e28157734e022d61d8ac09f1f3d91f0e62d344bc /include | |
parent | 43e805a00d1835db4fc0730ce5003956824b350d (diff) | |
download | i3-e1d3e6b2f6c721c03022e4f80a9844f189d1862c.tar.gz i3-e1d3e6b2f6c721c03022e4f80a9844f189d1862c.zip |
Fix transient_for endless loop
Other approaches would be:
- Slow/fast pointer technique.
- Using a set/associative map to save 'seen' nodes. i3 does not have
such data structure.
Counting the total amount of windows is the simpler to implement.
I've also extracted the logic in a function and re-used it in render.c.
Fixes #4404
Diffstat (limited to 'include')
-rw-r--r-- | include/con.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/con.h b/include/con.h index d8330098..3cea6780 100644 --- a/include/con.h +++ b/include/con.h @@ -209,6 +209,14 @@ Con *con_by_frame_id(xcb_window_t frame); Con *con_by_mark(const char *mark); /** + * Start from a container and traverse the transient_for linked list. Returns + * true if target window is found in the list. Protects againsts potential + * cycles. + * + */ +bool con_find_transient_for_window(Con *start, xcb_window_t target); + +/** * Returns true if and only if the given containers holds the mark. * */ |