diff --git a/QuickLook/ViewWindowManager.cs b/QuickLook/ViewWindowManager.cs index 4c8fe4c..20a40df 100644 --- a/QuickLook/ViewWindowManager.cs +++ b/QuickLook/ViewWindowManager.cs @@ -52,7 +52,7 @@ namespace QuickLook if (focus != NativeMethods.QuickLook.FocusedWindowType.Invalid) { StopFocusMonitor(); - _viewerWindow.BeginHide(); + _viewerWindow.Close(); return; } @@ -61,7 +61,7 @@ namespace QuickLook return; StopFocusMonitor(); - _viewerWindow.RunAndHide(); + _viewerWindow.RunAndClose(); } public void ClosePreview() @@ -70,7 +70,7 @@ namespace QuickLook return; StopFocusMonitor(); - _viewerWindow.BeginHide(); + _viewerWindow.Close(); } public void TogglePreview(string path = null) @@ -151,7 +151,7 @@ namespace QuickLook { var plugin = _viewerWindow.Plugin?.GetType(); - _viewerWindow.BeginHide(); + _viewerWindow.Close(); TrayIconManager.ShowNotification($"Failed to preview {Path.GetFileName(path)}", "Consider reporting this incident to QuickLook’s author.", true); diff --git a/QuickLook/ViewerWindow.Actions.cs b/QuickLook/ViewerWindow.Actions.cs index 278471a..19e4e83 100644 --- a/QuickLook/ViewerWindow.Actions.cs +++ b/QuickLook/ViewerWindow.Actions.cs @@ -49,12 +49,6 @@ namespace QuickLook } } - internal void RunAndHide() - { - Run(); - BeginHide(); - } - internal void RunAndClose() { Run(); @@ -261,27 +255,6 @@ namespace QuickLook buttonOpen.ToolTip = string.Format(TranslationHelper.Get("MW_Open"), Path.GetFileName(_path)); } - internal void BeginHide() - { - // reset custom window size - _customWindowSize = Size.Empty; - _ignoreNextWindowSizeChange = true; - - UnloadPlugin(); - - // if the this window is hidden in Max state, new show() will results in failure: - // "Cannot show Window when ShowActivated is false and WindowState is set to Maximized" - //WindowState = WindowState.Normal; - - Hide(); - //Dispatcher.BeginInvoke(new Action(Hide), DispatcherPriority.ApplicationIdle); - - ViewWindowManager.GetInstance().ForgetCurrentWindow(); - Close(); - - ProcessHelper.PerformAggressiveGC(); - } - protected override void OnClosing(CancelEventArgs e) { UnloadPlugin();