Skip to content

files-view: Check model empty selection after delayed signals emitted

Gary Li requested to merge li-gary/nautilus:select-first-searching-slow into main

When the user enter keystrokes to search, the first item sometimes gets deselected before being reselected.

This is due to the gtk_bitset_is_empty check in display_pending_files, which occurs before the delayed clear signals are emitted. On the first display_pending_files call after the keystroke, there may still be a non-empty selection. Since the check happens before clear is emitted, we errorneously believe there was a selection so we do not select first until display_pending_files is called again.

Move the no_selection bitset check to after we have emitted the delayed clear signal.

Before

before

After

after

Fixes: #3420 (closed)

Merge request reports