mirror of
https://github.com/kangyu-california/PersistentWindows.git
synced 2025-05-11 04:55:39 +02:00
undo speculative dpi awareness check
This commit is contained in:
parent
3c3b6b49db
commit
3aa6fb17e9
2 changed files with 2 additions and 17 deletions
|
@ -39,7 +39,6 @@ namespace PersistentWindows.Common.Models
|
|||
public RECT ScreenPosition { get; set; }
|
||||
public WindowPlacement WindowPlacement { get; set; }
|
||||
public bool NeedUpdateWindowPlacement { get; set; } //non-persistent data used for tmp argument passing only
|
||||
public uint Dpi { get; set; }
|
||||
|
||||
// window z-order
|
||||
public bool IsTopMost { get; set; }
|
||||
|
|
|
@ -2010,7 +2010,7 @@ namespace PersistentWindows.Common
|
|||
{
|
||||
if (debugWindows.Contains(hWnd))
|
||||
{
|
||||
string log = string.Format("Captured {0,-8} at ({1}, {2}) of size {3} x {4} {5} fullscreen:{6} minimized:{7}, dpi:{8}",
|
||||
string log = string.Format("Captured {0,-8} at ({1}, {2}) of size {3} x {4} {5} fullscreen:{6} minimized:{7}",
|
||||
curDisplayMetrics,
|
||||
curDisplayMetrics.ScreenPosition.Left,
|
||||
curDisplayMetrics.ScreenPosition.Top,
|
||||
|
@ -2018,8 +2018,7 @@ namespace PersistentWindows.Common
|
|||
curDisplayMetrics.ScreenPosition.Height,
|
||||
curDisplayMetrics.Title,
|
||||
curDisplayMetrics.IsFullScreen,
|
||||
curDisplayMetrics.IsMinimized,
|
||||
curDisplayMetrics.Dpi
|
||||
curDisplayMetrics.IsMinimized
|
||||
);
|
||||
Log.Event(log);
|
||||
|
||||
|
@ -2426,8 +2425,6 @@ namespace PersistentWindows.Common
|
|||
RECT screenPosition = new RECT();
|
||||
User32.GetWindowRect(hwnd, ref screenPosition);
|
||||
|
||||
uint dpi = User32.GetDpiForWindow(hwnd);
|
||||
|
||||
bool isMinimized = IsMinimized(hwnd);
|
||||
|
||||
IntPtr realHwnd = hwnd;
|
||||
|
@ -2465,7 +2462,6 @@ namespace PersistentWindows.Common
|
|||
WindowPlacement = windowPlacement,
|
||||
NeedUpdateWindowPlacement = false,
|
||||
ScreenPosition = screenPosition,
|
||||
Dpi = dpi,
|
||||
|
||||
IsTopMost = IsWindowTopMost(hwnd),
|
||||
NeedClearTopMost = false,
|
||||
|
@ -2605,16 +2601,6 @@ namespace PersistentWindows.Common
|
|||
}
|
||||
else if (!prevDisplayMetrics.ScreenPosition.Equals(curDisplayMetrics.ScreenPosition))
|
||||
{
|
||||
if (prevDisplayMetrics.Dpi > 0 && curDisplayMetrics.Dpi != prevDisplayMetrics.Dpi)
|
||||
{
|
||||
if (curDisplayMetrics.ScreenPosition.Width * curDisplayMetrics.Dpi == prevDisplayMetrics.ScreenPosition.Width * prevDisplayMetrics.Dpi)
|
||||
if (curDisplayMetrics.ScreenPosition.Height * curDisplayMetrics.Dpi == prevDisplayMetrics.ScreenPosition.Height * prevDisplayMetrics.Dpi)
|
||||
{
|
||||
// workaround #289
|
||||
Log.Error($"ignore sudden scale ratio change for {GetWindowTitle(hwnd)}, prev DPI {prevDisplayMetrics.Dpi}, prev location {prevDisplayMetrics.ScreenPosition}, cur DPI {curDisplayMetrics.Dpi}, cur location {curDisplayMetrics.ScreenPosition}");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
moved = true;
|
||||
}
|
||||
else if (!curDisplayMetrics.IsMinimized && prevDisplayMetrics.IsMinimized)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue