mirror of
https://github.com/kangyu-california/PersistentWindows.git
synced 2025-05-11 04:55:39 +02:00
automatically fix small negative y screen coordinate to avoid repeated recovery
This commit is contained in:
parent
3056a1bbec
commit
11cd6f568d
1 changed files with 7 additions and 1 deletions
|
@ -439,6 +439,11 @@ namespace Ninjacrab.PersistentWindows.Common
|
||||||
// compensate for GetWindowPlacement() failure to get real coordinate of snapped window
|
// compensate for GetWindowPlacement() failure to get real coordinate of snapped window
|
||||||
RECT screenPosition = new RECT();
|
RECT screenPosition = new RECT();
|
||||||
User32.GetWindowRect(hwnd, ref screenPosition);
|
User32.GetWindowRect(hwnd, ref screenPosition);
|
||||||
|
if (screenPosition.Top < 0 && screenPosition.Top > -15)
|
||||||
|
{
|
||||||
|
// automatically fix small negative y coordinate to avoid repeated recovery failure
|
||||||
|
screenPosition.Top = 0;
|
||||||
|
}
|
||||||
|
|
||||||
uint processId = 0;
|
uint processId = 0;
|
||||||
uint threadId = User32.GetWindowThreadProcessId(window.HWnd, out processId);
|
uint threadId = User32.GetWindowThreadProcessId(window.HWnd, out processId);
|
||||||
|
@ -518,7 +523,8 @@ namespace Ninjacrab.PersistentWindows.Common
|
||||||
monitorApplications[displayKey][curDisplayMetrics.Key].RecoverWindowPlacement = true;
|
monitorApplications[displayKey][curDisplayMetrics.Key].RecoverWindowPlacement = true;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
monitorApplications[displayKey][curDisplayMetrics.Key].WindowPlacement = curDisplayMetrics.WindowPlacement;
|
//monitorApplications[displayKey][curDisplayMetrics.Key].WindowPlacement = curDisplayMetrics.WindowPlacement;
|
||||||
|
needUpdate = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue