diff options
| author | André Marçais <andre@marcais.net> | 2026-01-12 15:50:39 +0100 |
|---|---|---|
| committer | Kenny Levinsen <kl@kl.wtf> | 2026-02-12 09:53:35 +0100 |
| commit | 438010938c38020c071841b43509185d67c462c6 (patch) | |
| tree | 3f041f450614c45554c08b49c9db621fb98b58d2 /CMake | |
| parent | 845cdb190f0c577789425cd9ea4772bd2fcfc836 (diff) | |
Fix logical error in criteria matching
When evaluating a __focused__ pattern, sway's logic is to consider the
pattern match to have failed for a given view and attribute if a view is
focused and the value of attribute in question of the focused view is
not that of the view in question. Expected behaviour is that the pattern
matches if there is a focused view and that the values of the attribute
for the focused view and the other view are equal. (See #6753, which is
the case where the `workspace` attribute is matched against.). I.e., if
we write out the function `criteria_matches_view` as a logical formula,
expected behaviour is
criteria_matches_view(criteria, view) <=>
forall (attribute, pattern) in criteria,
(pattern is __focused__ and
focused view exists and view.attribute == focused.attribute)
or
(pattern is not __focused__ and view.attribute =~ pattern)
but it is actually (pay attention to the fourth line)
criteria_matches_view(criteria, view) <=>
forall (attribute, pattern) in criteria,
(pattern is __focused__ and
(no focused view or view.attribute == focused.attribute))
or
(pattern is not __focused__ and view.attribute =~ pattern).
Fix program logic to reflect (the disjunctive form of) the first formula
to be compatible with i3. (In passing, this fixes #6753.)
Diffstat (limited to 'CMake')
0 files changed, 0 insertions, 0 deletions
