Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -270,5 +270,11 @@ public interface IPublicAPI
/// Non-C# plugins should use this method
/// </summary>
public void OpenAppUri(string appUri);

/// <summary>
/// Get Settings.LastQueryMode
/// Possible return values: "Empty", "Selected", "Preserved"
/// </summary>
public string GetLastQueryMode();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not use enum?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does enum support JSON rpc plugins? I wasn't sure.

}
}
5 changes: 5 additions & 0 deletions Flow.Launcher/PublicAPIInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,11 @@ public void OpenAppUri(Uri appUri)
public void RegisterGlobalKeyboardCallback(Func<int, int, SpecialKeyState, bool> callback) => _globalKeyboardHandlers.Add(callback);
public void RemoveGlobalKeyboardCallback(Func<int, int, SpecialKeyState, bool> callback) => _globalKeyboardHandlers.Remove(callback);

public string GetLastQueryMode()
{
return _settingsVM.Settings.LastQueryMode.ToString();
}

#endregion

#region Private Methods
Expand Down
12 changes: 9 additions & 3 deletions Plugins/Flow.Launcher.Plugin.ProcessKiller/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ private List<Result> CreateResultsFromQuery(Query query)
{
string termToSearch = query.Search;
var processlist = processHelper.GetMatchingProcesses(termToSearch);

if (!processlist.Any())
{
return null;
Expand All @@ -89,7 +89,10 @@ private List<Result> CreateResultsFromQuery(Query query)
Action = (c) =>
{
processHelper.TryKill(p);
_ = DelayAndReQueryAsync(query.RawQuery); // Re-query after killing process to refresh process list
if (_context.API.GetLastQueryMode() != "Empty")
{
_ = DelayAndReQueryAsync(query.RawQuery); // Re-query after killing process to refresh process list
}
return true;
}
});
Expand All @@ -114,7 +117,10 @@ private List<Result> CreateResultsFromQuery(Query query)
{
processHelper.TryKill(p.Process);
}
_ = DelayAndReQueryAsync(query.RawQuery); // Re-query after killing process to refresh process list
if (_context.API.GetLastQueryMode() != "Empty")
{
_ = DelayAndReQueryAsync(query.RawQuery); // Re-query after killing process to refresh process list
}
return true;
}
});
Expand Down