mirror of
https://github.com/kangyu-california/PersistentWindows.git
synced 2025-05-10 20:45:38 +02:00
improve robustness of full screen detection #94
This commit is contained in:
parent
23fd9ba665
commit
44b17d4225
1 changed files with 6 additions and 16 deletions
|
@ -1189,23 +1189,13 @@ namespace PersistentWindows.Common
|
|||
if (curDisplayKey.Contains(size))
|
||||
isFullScreen = true;
|
||||
|
||||
if (!isFullScreen)
|
||||
List<Display> displays = GetDisplays();
|
||||
foreach (var display in displays)
|
||||
{
|
||||
List<Display> displays = GetDisplays();
|
||||
foreach (var display in displays)
|
||||
{
|
||||
RECT screen = display.Position;
|
||||
RECT intersect = new RECT();
|
||||
if (!User32.IntersectRect(out intersect, ref screenPosition, ref screen))
|
||||
{
|
||||
//must intersect with all screens
|
||||
isFullScreen = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (intersect.Equals(screen))
|
||||
isFullScreen = true; //fully covers at least one screen
|
||||
}
|
||||
RECT screen = display.Position;
|
||||
RECT intersect = new RECT();
|
||||
if (User32.IntersectRect(out intersect, ref screenPosition, ref screen))
|
||||
isFullScreen = intersect.Equals(screen); //fully covers at least one screen
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue