aboutsummaryrefslogtreecommitdiff
path: root/i3-save-tree
diff options
context:
space:
mode:
authorOrestis Floros <orestisflo@gmail.com>2024-06-03 17:00:47 +0200
committerGitHub <noreply@github.com>2024-06-03 17:00:47 +0200
commit1ee963ede9aa02dc810df99676c488bfd1868dfa (patch)
tree377a9d81730d4955ac0d791409356a504db6a463 /i3-save-tree
parent11c0a9567facc14daafa07aa7b029eef09e62ad6 (diff)
downloadi3-next.tar.gz
i3-next.zip
Fix crash with focus output and scratchpad (#6079)HEADnext
The crash was brought up in a comment in https://github.com/i3/i3/discussions/6076#discussioncomment-9536969 The cause is that the command criteria are matching a window in the scratchpad. In that case, the assertion in get_output_for_con() fails. That happens because there is no `Output` for the `Con` output of a scratchpad window. I've decided to *not* remove the offending assertion but rather rely on the caller not using the function with internal containers. My reasoning is: 1. If get_output_for_con can return NULL then the caller will either segfault (which is worse) or needs to check the return for NULL. 2. The case where the return can be NULL is already known, it happens for internal containers. 3. Therefore, the caller should already prevent the situation with a call to con_is_internal(). Thus, the `assert`ion can remain. There is also the potential fix of con_get_workspace returning some arbitrary output (e.g. first in the list or currently focused one) instead of NULL. This can lead to more tricky to catch bugs.
Diffstat (limited to 'i3-save-tree')
0 files changed, 0 insertions, 0 deletions