From 5a5902d580662d9f3bc1bc8cb4dab3b0d670b5be Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Tue, 20 Jul 2021 16:04:41 -0500 Subject: [PATCH] Prevent the quake window's borders from hanging onto adjacent monitors (#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. --- src/cascadia/WindowsTerminal/IslandWindow.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cascadia/WindowsTerminal/IslandWindow.cpp b/src/cascadia/WindowsTerminal/IslandWindow.cpp index 6278b6c2026..4236102f025 100644 --- a/src/cascadia/WindowsTerminal/IslandWindow.cpp +++ b/src/cascadia/WindowsTerminal/IslandWindow.cpp @@ -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(nearestMonitorInfo.rcWork.left, (ncSize.width() / 2)), + ::base::ClampSub(nearestMonitorInfo.rcWork.left, (ncSize.width() / 2)) + 1, (nearestMonitorInfo.rcWork.top) }; const til::size dimensions{ - availableSpace.width(), + availableSpace.width() - 2, availableSpace.height() / 2 };