mirror of
https://github.com/ShareX/ShareX.git
synced 2024-07-01 04:30:49 +12:00
Ignore desktop when checking for fullscreen
This commit is contained in:
parent
b7a9d10ec3
commit
79bcce9623
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue