mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge pull request #2170 from JohnTheGr8/kill_honor_last_query_style
plugin/ProcessKiller: honor "Last Query Style" after kill
This commit is contained in:
commit
22dd59eef8
2 changed files with 7 additions and 11 deletions
|
|
@ -1,7 +1,6 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Flow.Launcher.Infrastructure;
|
using Flow.Launcher.Infrastructure;
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Flow.Launcher.Plugin.ProcessKiller
|
namespace Flow.Launcher.Plugin.ProcessKiller
|
||||||
{
|
{
|
||||||
|
|
@ -89,7 +88,8 @@ namespace Flow.Launcher.Plugin.ProcessKiller
|
||||||
Action = (c) =>
|
Action = (c) =>
|
||||||
{
|
{
|
||||||
processHelper.TryKill(p);
|
processHelper.TryKill(p);
|
||||||
_ = DelayAndReQueryAsync(query.RawQuery); // Re-query after killing process to refresh process list
|
// Re-query to refresh process list
|
||||||
|
_context.API.ChangeQuery(query.RawQuery, true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -114,7 +114,8 @@ namespace Flow.Launcher.Plugin.ProcessKiller
|
||||||
{
|
{
|
||||||
processHelper.TryKill(p.Process);
|
processHelper.TryKill(p.Process);
|
||||||
}
|
}
|
||||||
_ = DelayAndReQueryAsync(query.RawQuery); // Re-query after killing process to refresh process list
|
// Re-query to refresh process list
|
||||||
|
_context.API.ChangeQuery(query.RawQuery, true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -122,11 +123,5 @@ namespace Flow.Launcher.Plugin.ProcessKiller
|
||||||
|
|
||||||
return sortedResults;
|
return sortedResults;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async Task DelayAndReQueryAsync(string query)
|
|
||||||
{
|
|
||||||
await Task.Delay(500);
|
|
||||||
_context.API.ChangeQuery(query, true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
using Flow.Launcher.Infrastructure;
|
using Flow.Launcher.Infrastructure;
|
||||||
using Flow.Launcher.Infrastructure.Logger;
|
using Flow.Launcher.Infrastructure.Logger;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
@ -75,6 +75,7 @@ namespace Flow.Launcher.Plugin.ProcessKiller
|
||||||
if (!p.HasExited)
|
if (!p.HasExited)
|
||||||
{
|
{
|
||||||
p.Kill();
|
p.Kill();
|
||||||
|
p.WaitForExit(50);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue