Fix crash when switching preview while maximized

This commit is contained in:
Paddy Xu
2017-06-27 21:44:37 +03:00
parent 7e63636141
commit 2e1b53965b

View File

@@ -90,6 +90,10 @@ namespace QuickLook
return;
}
// is the window is now now maximized, do not move it
if (WindowState == WindowState.Maximized)
return;
// if this is a new window, place it to top
if (Visibility != Visibility.Visible)
this.BringToFront();
@@ -145,7 +149,8 @@ namespace QuickLook
ResizeAndCenter(new Size(newWidth, newHeight));
Show();
if (Visibility != Visibility.Visible)
Show();
//WindowHelper.SetActivate(new WindowInteropHelper(this), ContextObject.CanFocus);