mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-10 05:06:36 +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.FilePreviewer;
|
||||||
using Peek.UI.Telemetry.Events;
|
using Peek.UI.Telemetry.Events;
|
||||||
using Peek.UI.Views;
|
using Peek.UI.Views;
|
||||||
using WinUIEx;
|
|
||||||
|
|
||||||
namespace Peek.UI
|
namespace Peek.UI
|
||||||
{
|
{
|
||||||
@@ -95,9 +94,6 @@ namespace Peek.UI
|
|||||||
}
|
}
|
||||||
|
|
||||||
Window = new MainWindow();
|
Window = new MainWindow();
|
||||||
|
|
||||||
Window.Activate();
|
|
||||||
Window.Hide();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void App_UnhandledException(object sender, Microsoft.UI.Xaml.UnhandledExceptionEventArgs e)
|
private void App_UnhandledException(object sender, Microsoft.UI.Xaml.UnhandledExceptionEventArgs e)
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ namespace Peek.UI
|
|||||||
public MainWindowViewModel ViewModel { get; }
|
public MainWindowViewModel ViewModel { get; }
|
||||||
|
|
||||||
private ThemeListener? themeListener;
|
private ThemeListener? themeListener;
|
||||||
|
private bool activated;
|
||||||
|
|
||||||
public MainWindow()
|
public MainWindow()
|
||||||
{
|
{
|
||||||
@@ -84,6 +85,15 @@ namespace Peek.UI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void OnPeekHotkey()
|
private void OnPeekHotkey()
|
||||||
{
|
{
|
||||||
|
// First Peek activation
|
||||||
|
if (!activated)
|
||||||
|
{
|
||||||
|
Activate();
|
||||||
|
Initialize();
|
||||||
|
activated = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (AppWindow.IsVisible)
|
if (AppWindow.IsVisible)
|
||||||
{
|
{
|
||||||
if (IsNewSingleSelectedItem())
|
if (IsNewSingleSelectedItem())
|
||||||
|
|||||||
Reference in New Issue
Block a user