Skip to content

Commit

Permalink
don't bring existing window to the front
Browse files Browse the repository at this point in the history
  • Loading branch information
xupefei committed May 20, 2020
1 parent 5a02558 commit f8416ba
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions QuickLook/ViewerWindow.Actions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ internal void RunAndClose()
BeginClose();
}

private void ResizeAndCentre(Size size)
private void PositionWindow(Size size)
{
// if the window is now now maximized, do not move it
if (WindowState == WindowState.Maximized)
Expand Down Expand Up @@ -203,11 +203,13 @@ internal void BeginShow(IViewer matchedPlugin, string path,
else
_ignoreNextWindowSizeChange = true;

ResizeAndCentre(newSize);
Dispatcher.BeginInvoke(new Action(() => this.BringToFront(Topmost)), DispatcherPriority.Render);
PositionWindow(newSize);

if (Visibility != Visibility.Visible)
{
Dispatcher.BeginInvoke(new Action(() => this.BringToFront(Topmost)), DispatcherPriority.Render);
Show();
}

//ShowWindowCaptionContainer(null, null);
//WindowHelper.SetActivate(new WindowInteropHelper(this), ContextObject.CanFocus);
Expand Down

0 comments on commit f8416ba

Please sign in to comment.