main: fix --auto-select combined with --search
Before adoption: this commit came in with the history the project adopted, so no landing records it.
This fixes an issue where --auto-select in combination with --search did not exit automatically when --search resulted in a single item. Handle both dmenu and application mode in the same way, by triggering the check after all entries have been loaded, and the match result has been updated. Add wayl_check_auto_select() for this purpose. This function is only used for this corner case, and not when checking auto-select after a key press, since it's inferior - we don't have an associated seat. Instead, this function always uses the "first" seat, whatever that is. For all of this to work, wayl_check_auto_select() must cancel the pending wayland socket read; executing an application (i.e. in application mode), causes fuzzel to try to receive an XDG activation token. This requires a wayland roundtrip. This doesn't work when wl_display_prepare_read() is active. Which it is, unless we're in an fdm_handler() callchain. And in this case we're not. Hence we must cancel it, and then re-enable it. This also means wayl_check_auto_select() *must not* be called from within an fdm_handler() callchain. Closes #633
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+43 added−7 removed
- other:+43 added−7 removed