Skip to content

Commit

Permalink
Prevent the quake window's borders from hanging onto adjacent monitors (
Browse files Browse the repository at this point in the history
#10676)

## Summary of the Pull Request

We were making the quake window exactly the width of the monitor it was on, but that didn't account for the 1px of border on either side.		

## References
* megathread: #8888

## PR Checklist
* [x] Closes #10201
* [x] I work here
* [ ] Tests added/passed
* [n/a] Requires documentation to be updated

## Validation Steps Performed

It happened before, it doesn't anymore.
  • Loading branch information
zadjii-msft authored Jul 20, 2021
1 parent 0fefdac commit 5a5902d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/cascadia/WindowsTerminal/IslandWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1460,12 +1460,15 @@ void IslandWindow::_enterQuakeMode()
const til::size ncSize{ GetTotalNonClientExclusiveSize(dpix) };
const til::size availableSpace = desktopDimensions + ncSize;

// GH#10201 - The borders are still visible in quake mode, so make us 1px
// smaller on either side to account for that, so they don't hang onto
// adjacent monitors.
const til::point origin{
::base::ClampSub<long>(nearestMonitorInfo.rcWork.left, (ncSize.width() / 2)),
::base::ClampSub<long>(nearestMonitorInfo.rcWork.left, (ncSize.width() / 2)) + 1,
(nearestMonitorInfo.rcWork.top)
};
const til::size dimensions{
availableSpace.width(),
availableSpace.width() - 2,
availableSpace.height() / 2
};

Expand Down

0 comments on commit 5a5902d

Please sign in to comment.