From 25ad30a4a33973537cf08df5d4b544c9b04d6f9c Mon Sep 17 00:00:00 2001 From: Berry Wahlberg <40695099+BerryUIKI@users.noreply.github.com> Date: Fri, 18 Sep 2026 09:37:32 +0800 Subject: [PATCH] Dismiss preview window when invoking Open With action (#1267) --- QuickLook/ViewerWindow.xaml.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/QuickLook/ViewerWindow.xaml.cs b/QuickLook/ViewerWindow.xaml.cs index 7eb190af7..a7586fd8b 100644 --- a/QuickLook/ViewerWindow.xaml.cs +++ b/QuickLook/ViewerWindow.xaml.cs @@ -1,4 +1,4 @@ -// Copyright © 2017-2026 QL-Win Contributors +// Copyright © 2017-2026 QL-Win Contributors // // This file is part of QuickLook program. // @@ -134,7 +134,14 @@ internal ViewerWindow() WindowState = WindowState == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized; buttonShare.Click += (_, _) => ShareHelper.Share(_path, this); - buttonOpenWith.Click += (_, _) => ShareHelper.Share(_path, this, true); + buttonOpenWith.Click += (_, _) => + { + ShareHelper.Share(_path, this, true); + if (Pinned) + Close(); + else + ViewWindowManager.GetInstance().ClosePreview(); + }; buttonReload.Visibility = SettingHelper.Get("ShowReload", false) ? Visibility.Visible : Visibility.Collapsed;