Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential fix for displays with different DPI scale settings #429

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions SidebarDiagnostics/Windows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,10 @@ public static void GetWorkArea(AppBarWindow window, out int screen, out DockEdge
};

windowWA = Windows.WorkArea.FromRECT(_active.WorkArea);
windowWA.Scale(_active.InverseScaleX, _active.InverseScaleY);

double scaleX = _active.ScaleX / _primary.ScaleX;
double scaleY = _active.ScaleY / _primary.ScaleY;
windowWA.Scale(scaleX, scaleY);

double _modifyX = 0d;
double _modifyY = 0d;
Expand All @@ -889,6 +892,9 @@ public static void GetWorkArea(AppBarWindow window, out int screen, out DockEdge

windowWA.Offset(_offsetX, _offsetY);

windowWA.Top = 0;
windowWA.Bottom = _active.WorkArea.Height;

appbarWA = Windows.WorkArea.FromRECT(_active.WorkArea);

appbarWA.Offset(_modifyX, _modifyY);
Expand Down Expand Up @@ -1530,4 +1536,4 @@ private IntPtr AppBarHook(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, re

private CancellationTokenSource _cancelReposition { get; set; }
}
}
}