Fix for the detection of the currently active non-EVE app

This commit is contained in:
Anton Kasyanov
2019-03-04 22:37:10 +02:00
parent 937de0342d
commit cfcc5d085c

View File

@@ -195,9 +195,14 @@ namespace EveOPreview.Services
foregroundWindowTitle = foregroundView.Title; foregroundWindowTitle = foregroundView.Title;
} }
else if (!isClientWindow) else if (!isClientWindow)
{
// Under some circumstances Foreground WindowHandle can be zero
// (f.e. when Thumbnail is silently stealing focus from the currently open app)
if (foregroundWindowHandle != IntPtr.Zero)
{ {
this._externalApplication = foregroundWindowHandle; this._externalApplication = foregroundWindowHandle;
} }
}
// No need to minimize EVE clients when switching out to non-EVE window (like thumbnail) // No need to minimize EVE clients when switching out to non-EVE window (like thumbnail)
if (!string.IsNullOrEmpty(foregroundWindowTitle)) if (!string.IsNullOrEmpty(foregroundWindowTitle))