Skip to content

Commit

Permalink
Resize the drag bar on WM_DISPLAYCHANGE (#4829)
Browse files Browse the repository at this point in the history
## Summary of the Pull Request

Pretty straightforward. When we get a `WM_DISPLAYCHANGE`, that means the
display's DPI changed. When that happens, resize the drag bar, so that
it'll reflect the new scaling.

Unblocks #4778 
Closes #4166

## Validation
Man I've changed the DPI of my displays so many times in the last 30
minutes. I dragged the window across a bunch of DPI boundaries too.
  • Loading branch information
zadjii-msft authored Mar 6, 2020
1 parent be77b2a commit d8f7aac
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/cascadia/WindowsTerminal/NonClientIslandWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,11 @@ void NonClientIslandWindow::_UpdateFrameMargins() const noexcept
{
switch (message)
{
case WM_DISPLAYCHANGE:
// GH#4166: When the DPI of the monitor changes out from underneath us,
// resize our drag bar, to reflect its newly scaled size.
_UpdateIslandRegion();
return 0;
case WM_NCCALCSIZE:
return _OnNcCalcSize(wParam, lParam);
case WM_NCHITTEST:
Expand Down

0 comments on commit d8f7aac

Please sign in to comment.