mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge pull request #2751 from Flow-Launcher/prevent-new-query-when-exiting-context-menu
Don't re-run queries after returning from context menu
This commit is contained in:
commit
7af3bd1560
1 changed files with 16 additions and 1 deletions
|
|
@ -670,12 +670,27 @@ namespace Flow.Launcher.ViewModel
|
|||
get { return _selectedResults; }
|
||||
set
|
||||
{
|
||||
var isReturningFromContextMenu = ContextMenuSelected();
|
||||
_selectedResults = value;
|
||||
if (SelectedIsFromQueryResults())
|
||||
{
|
||||
ContextMenu.Visibility = Visibility.Collapsed;
|
||||
History.Visibility = Visibility.Collapsed;
|
||||
ChangeQueryText(_queryTextBeforeLeaveResults);
|
||||
|
||||
// QueryText setter (used in ChangeQueryText) runs the query again, resetting the selected
|
||||
// result from the one that was selected before going into the context menu to the first result.
|
||||
// The code below correctly restores QueryText and puts the text caret at the end without
|
||||
// running the query again when returning from the context menu.
|
||||
if (isReturningFromContextMenu)
|
||||
{
|
||||
_queryText = _queryTextBeforeLeaveResults;
|
||||
OnPropertyChanged(nameof(QueryText));
|
||||
QueryTextCursorMovedToEnd = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ChangeQueryText(_queryTextBeforeLeaveResults);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue