Present Windows Effect: Allow imprecise match on filtering windows
Needs ReviewPublic

Authored by leandrosantiago on Mar 2 2019, 1:43 PM.

Details

Reviewers
None
Group Reviewers
KWin
Summary

This change enables non precise match on filtering open windows when using the 'present windows' effect.

So, if firefox is open, the user can filter it by typing 'ffox', for instance, instead of needing to type a
'perfect match', like "firefox".

I tested it on ArchLinux using the wayland backend.

Please note this is not a finished patch. The configuration windows need polishing,
by adding a new section "Behaviour", with the new checkbox.

As I have no much experience nor enjoy working with visual user interfaces,
I ask someone else to implement this part of the feature.

Test Plan

No unit tests have been added.

Diff Detail

Repository
R108 KWin
Branch
feature/unprecisepresentation
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 9086
Build 9104: arc lint + arc unit
leandrosantiago created this revision.Mar 2 2019, 1:43 PM
Restricted Application added a project: KWin. · View Herald TranscriptMar 2 2019, 1:43 PM
leandrosantiago requested review of this revision.Mar 2 2019, 1:43 PM
ngraham edited reviewers, added: KWin; removed: kwin.Mar 2 2019, 2:08 PM
Restricted Application added a subscriber: kwin. · View Herald TranscriptMar 2 2019, 2:08 PM

Lets say I have a window
"D19473 Present Windows Effect: Allow imprecise match on filtering windows - Mozilla Firefox"

And search for "telegram", I'm going to get all the way to "telegr" before the test fails.
(d19473 presenT windows Effect: aLlow imprEcise match on filterinG windows - mozilla fiRefox)

It's hindering the original goal of making things faster to search.
I fear it's going to appear broken to the end user who can't see why it's showing these false positives, even if this is an option.

ngraham added a subscriber: ngraham.Mar 2 2019, 9:18 PM

And search for "telegram", I'm going to get all the way to "telegr" before the test fails.
(d19473 presenT windows Effect: aLlow imprEcise match on filterinG windows - mozilla fiRefox)

It's hindering the original goal of making things faster to search.
I fear it's going to appear broken to the end user who can't see why it's showing these false positives, even if this is an option.

I'm afraid I have to agree.

zzag added a subscriber: zzag.Mar 4 2019, 10:27 AM

I also agree with David. For end users it will look broken (unless matched characters are visualized and even in that case I think it's not worth that). Algorithm-wise, I'm not sure whether the proposed fuzzy string matching algortihm is good enough.

Lets say I have a window
"D19473 Present Windows Effect: Allow imprecise match on filtering windows - Mozilla Firefox"

And search for "telegram", I'm going to get all the way to "telegr" before the test fails.
(d19473 presenT windows Effect: aLlow imprEcise match on filterinG windows - mozilla fiRefox)

It's hindering the original goal of making things faster to search.
I fear it's going to appear broken to the end user who can't see why it's showing these false positives, even if this is an option.

That's a good counterexample I had not though about :-)

Thank you all for the comments.

One improvement I can think of, as zzag suggested is somehow highlighting the matched characters in the windows titles.

Another one, algorithm-wise maybe not considering non alphanumeric chars as part of the "gaps" between two chars in the filter.

So that "firefox: a windows title page - subtitle" won't match to ffoxsub, but will match to ffox:-sub, as : and - must be present. It would make matching user@machine: /opt/cling/lib/clang/5.0.0/include with something like 'machineinclude' quite complicated, due the number of '/'s in between.

Another one is making the search case sensitive, what would certainly solve the "telegram" issue above mentioned, but would feel awkward as the behaviour is different from the 'precise' filtering, which is case insensitive. I personally would not mind having a case sensitive filter.

Please let me know if you have any idea for improvements or better filtering algorithm.

Cheers,
Leandro