Ignore desktop when checking for fullscreen

This commit is contained in:
Jaex 2019-04-20 23:23:30 +03:00
parent b7a9d10ec3
commit 79bcce9623
2 changed files with 11 additions and 4 deletions

View file

@ -352,9 +352,16 @@ public static bool IsActiveWindowFullscreen()
if (handle.ToInt32() > 0)
{
Rectangle windowRectangle = GetWindowRectangle(handle);
Rectangle monitorRectangle = Screen.FromRectangle(windowRectangle).Bounds;
return windowRectangle.Contains(monitorRectangle);
WindowInfo windowInfo = new WindowInfo(handle);
string className = windowInfo.ClassName;
string[] ignoreList = new string[] { "Progman", "WorkerW" };
if (ignoreList.All(ignore => !className.Equals(ignore, StringComparison.OrdinalIgnoreCase)))
{
Rectangle windowRectangle = windowInfo.Rectangle;
Rectangle monitorRectangle = Screen.FromRectangle(windowRectangle).Bounds;
return windowRectangle.Contains(monitorRectangle);
}
}
return false;

View file

@ -73,7 +73,7 @@ private bool IsClassNameAllowed(WindowInfo window)
if (!string.IsNullOrEmpty(className))
{
return ignoreList.All(ignore => !className.Equals(ignore, StringComparison.InvariantCultureIgnoreCase));
return ignoreList.All(ignore => !className.Equals(ignore, StringComparison.OrdinalIgnoreCase));
}
return true;