mirror of
https://github.com/greenshot/greenshot
synced 2025-07-07 13:32:12 -07:00
Fix capturing Maximised windows.
This commit is contained in:
parent
f50f205b70
commit
36a285ebd4
1 changed files with 39 additions and 52 deletions
|
@ -550,8 +550,8 @@ namespace Greenshot.Base.Core
|
||||||
{
|
{
|
||||||
// Try to return a cached value
|
// Try to return a cached value
|
||||||
long now = DateTime.Now.Ticks;
|
long now = DateTime.Now.Ticks;
|
||||||
if (_previousWindowRectangle.IsEmpty || !_frozen)
|
if (!_previousWindowRectangle.IsEmpty && _frozen) return _previousWindowRectangle;
|
||||||
{
|
|
||||||
if (!_previousWindowRectangle.IsEmpty && now - _lastWindowRectangleRetrieveTime <= CacheTime)
|
if (!_previousWindowRectangle.IsEmpty && now - _lastWindowRectangleRetrieveTime <= CacheTime)
|
||||||
{
|
{
|
||||||
return _previousWindowRectangle;
|
return _previousWindowRectangle;
|
||||||
|
@ -590,17 +590,6 @@ namespace Greenshot.Base.Core
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Correction for maximized windows
|
|
||||||
if (!HasParent && Maximised)
|
|
||||||
{
|
|
||||||
// Only if the border size can be retrieved
|
|
||||||
if (GetBorderSize(out var size))
|
|
||||||
{
|
|
||||||
windowRect = new NativeRect(windowRect.X + size.Width, windowRect.Y + size.Height, windowRect.Width - (2 * size.Width),
|
|
||||||
windowRect.Height - (2 * size.Height));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
_lastWindowRectangleRetrieveTime = now;
|
_lastWindowRectangleRetrieveTime = now;
|
||||||
// Try to return something valid, by getting returning the previous size if the window doesn't have a NativeRect anymore
|
// Try to return something valid, by getting returning the previous size if the window doesn't have a NativeRect anymore
|
||||||
if (windowRect.IsEmpty)
|
if (windowRect.IsEmpty)
|
||||||
|
@ -610,9 +599,7 @@ namespace Greenshot.Base.Core
|
||||||
|
|
||||||
_previousWindowRectangle = windowRect;
|
_previousWindowRectangle = windowRect;
|
||||||
return windowRect;
|
return windowRect;
|
||||||
}
|
|
||||||
|
|
||||||
return _previousWindowRectangle;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue