1
0
mirror of https://gitlab.gnome.org/GNOME/nautilus synced 2024-06-30 23:46:35 +00:00

files-view: Don't always reload on global search

In [1], global search was excluded from skipping the reloading of
the view like normal search in order for the current content of the
view to not appear in the global search for a short time until the
results were loaded. This causes global search results to flicker
for every key stroke.

Instead, make the condition more specific so that it will not
affect loading between search queries.

[1] ce47e61372

Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/3403
This commit is contained in:
Khalid Abu Shawarib 2024-05-27 23:50:25 +03:00 committed by Peter Eisenmann
parent a9ca62f771
commit 0aab4b8458

View File

@ -8715,15 +8715,17 @@ load_directory (NautilusFilesView *view,
priv = nautilus_files_view_get_instance_private (view);
nautilus_files_view_stop_loading (view);
if (NAUTILUS_IS_SEARCH_DIRECTORY (directory) || NAUTILUS_IS_SEARCH_DIRECTORY (priv->directory))
/* To make search feel fast and smooth as if it were filtering the current
* view, avoid blanking the view temporarily in the following cases:
* 1- Going from a search to a search
* 2- Going from a location to local search
*/
if (NAUTILUS_IS_SEARCH_DIRECTORY (directory) &&
(NAUTILUS_IS_SEARCH_DIRECTORY (priv->directory) ||
(priv->search_query != NULL && !nautilus_query_is_global (priv->search_query))))
{
if (priv->search_query != NULL &&
!nautilus_query_is_global (priv->search_query))
{
/* To make search feel fast and smooth as if it were filtering the
* current view, avoid blanking the view temporarily. */
search_transition_schedule_delayed_signals (view);
}
search_transition_schedule_delayed_signals (view);
}
emit_clear (view);