mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 17:56:44 +02:00
[Peek]Delayed activation of the Peek window (#27444)
This commit is contained in:
committed by
GitHub
parent
7e4e8f59bb
commit
65916fd51a
@@ -11,7 +11,6 @@ using Microsoft.UI.Xaml;
|
||||
using Peek.FilePreviewer;
|
||||
using Peek.UI.Telemetry.Events;
|
||||
using Peek.UI.Views;
|
||||
using WinUIEx;
|
||||
|
||||
namespace Peek.UI
|
||||
{
|
||||
@@ -95,9 +94,6 @@ namespace Peek.UI
|
||||
}
|
||||
|
||||
Window = new MainWindow();
|
||||
|
||||
Window.Activate();
|
||||
Window.Hide();
|
||||
}
|
||||
|
||||
private void App_UnhandledException(object sender, Microsoft.UI.Xaml.UnhandledExceptionEventArgs e)
|
||||
|
||||
@@ -28,6 +28,7 @@ namespace Peek.UI
|
||||
public MainWindowViewModel ViewModel { get; }
|
||||
|
||||
private ThemeListener? themeListener;
|
||||
private bool activated;
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
@@ -84,6 +85,15 @@ namespace Peek.UI
|
||||
/// </summary>
|
||||
private void OnPeekHotkey()
|
||||
{
|
||||
// First Peek activation
|
||||
if (!activated)
|
||||
{
|
||||
Activate();
|
||||
Initialize();
|
||||
activated = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (AppWindow.IsVisible)
|
||||
{
|
||||
if (IsNewSingleSelectedItem())
|
||||
|
||||
Reference in New Issue
Block a user