mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Wrap querytext change with Dispatcher to ensure it happens after mainwindow showup.
This commit is contained in:
parent
c5056a7a5c
commit
29081ec281
1 changed files with 14 additions and 9 deletions
|
|
@ -66,7 +66,8 @@ namespace Flow.Launcher.ViewModel
|
|||
Settings = settings;
|
||||
Settings.PropertyChanged += (_, args) =>
|
||||
{
|
||||
switch (args.PropertyName) {
|
||||
switch (args.PropertyName)
|
||||
{
|
||||
case nameof(Settings.WindowSize):
|
||||
OnPropertyChanged(nameof(MainWindowWidth));
|
||||
break;
|
||||
|
|
@ -366,6 +367,7 @@ namespace Flow.Launcher.ViewModel
|
|||
set
|
||||
{
|
||||
_queryText = value;
|
||||
OnPropertyChanged();
|
||||
Query();
|
||||
}
|
||||
}
|
||||
|
|
@ -429,11 +431,14 @@ namespace Flow.Launcher.ViewModel
|
|||
{
|
||||
if (QueryText != queryText)
|
||||
{
|
||||
// re-query is done in QueryText's setter method
|
||||
QueryText = queryText;
|
||||
// set to false so the subsequent set true triggers
|
||||
// PropertyChanged and MoveQueryTextToEnd is called
|
||||
QueryTextCursorMovedToEnd = false;
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
// re-query is done in QueryText's setter method
|
||||
QueryText = queryText;
|
||||
// set to false so the subsequent set true triggers
|
||||
// PropertyChanged and MoveQueryTextToEnd is called
|
||||
QueryTextCursorMovedToEnd = false;
|
||||
});
|
||||
}
|
||||
else if (reQuery)
|
||||
{
|
||||
|
|
@ -752,7 +757,7 @@ namespace Flow.Launcher.ViewModel
|
|||
|
||||
queryBuilder.Replace('@' + shortcut.Key, shortcut.Expand());
|
||||
}
|
||||
|
||||
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
foreach (var shortcut in builtInShortcuts)
|
||||
|
|
@ -887,9 +892,9 @@ namespace Flow.Launcher.ViewModel
|
|||
{
|
||||
MainWindowVisibility = Visibility.Visible;
|
||||
|
||||
MainWindowVisibilityStatus = true;
|
||||
|
||||
MainWindowOpacity = 1;
|
||||
|
||||
MainWindowVisibilityStatus = true;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue