mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-17 05:42:42 +00:00
the plug-in might be disposed before COM finishes when pressing SPACE key tooooo fast
This commit is contained in:
@@ -127,6 +127,9 @@ namespace QuickLook.Plugin.IPreviewHandlers
|
|||||||
if (_mCurrentPreviewHandler == null)
|
if (_mCurrentPreviewHandler == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (IsDisposed)
|
||||||
|
return false;
|
||||||
|
|
||||||
// bind the preview handler to the control's bounds and preview the content
|
// bind the preview handler to the control's bounds and preview the content
|
||||||
var r = ClientRectangle;
|
var r = ClientRectangle;
|
||||||
_mCurrentPreviewHandler.SetWindow(Handle, ref r);
|
_mCurrentPreviewHandler.SetWindow(Handle, ref r);
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Interop;
|
|
||||||
using System.Windows.Threading;
|
using System.Windows.Threading;
|
||||||
|
|
||||||
namespace QuickLook.Plugin.IPreviewHandlers
|
namespace QuickLook.Plugin.IPreviewHandlers
|
||||||
@@ -37,10 +36,10 @@ namespace QuickLook.Plugin.IPreviewHandlers
|
|||||||
_control = new PreviewHandlerHost();
|
_control = new PreviewHandlerHost();
|
||||||
presenter.Child = _control;
|
presenter.Child = _control;
|
||||||
_control.Open(file);
|
_control.Open(file);
|
||||||
}), DispatcherPriority.Render);
|
}), DispatcherPriority.Loaded);
|
||||||
|
|
||||||
SetForegroundWindow(new WindowInteropHelper(context.ViewerWindow).Handle);
|
//SetForegroundWindow(new WindowInteropHelper(context.ViewerWindow).Handle);
|
||||||
SetActiveWindow(presenter.Handle);
|
//SetActiveWindow(presenter.Handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("user32.dll")]
|
[DllImport("user32.dll")]
|
||||||
|
Reference in New Issue
Block a user