[PR #2150] [MERGED] Fix the terminal snapping across DPI boundaries strangely. #24833

Open
opened 2026-01-31 09:05:36 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/2150
Author: @zadjii-msft
Created: 7/30/2019
Status: Merged
Merged: 7/30/2019
Merged by: @DHowett-MSFT

Base: masterHead: dev/migrie/b/snap-padding


📝 Commits (1)

  • 7015128 This seems to work, but is it as right as it could be? Does it work for the normal (non-tabs in titlebar) window?

📊 Changes

1 file changed (+6 additions, -0 deletions)

View changed files

📝 src/cascadia/WindowsTerminal/NonClientIslandWindow.cpp (+6 -0)

📄 Description

Summary of the Pull Request

When we snap across a DPI boundary, we'll get the DPI changed message after the resize message. So when we try to calculate the new terminal position, we'll use the old DPI to calculate the size. When snapping to a lower DPI, this means the terminal will be smaller, with "padding" all around the actual app.

Instead, when we get a new DPI, force us to update out UI layout for the new DPI.

PR Checklist

Validation Steps Performed

Snapped the terminal a bunch back and forth on my monitors.

Checked this works fine for showTabsInTitlebar: false.

Tried snapping into corners from high to low back to high DPI


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/2150 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 7/30/2019 **Status:** ✅ Merged **Merged:** 7/30/2019 **Merged by:** [@DHowett-MSFT](https://github.com/DHowett-MSFT) **Base:** `master` ← **Head:** `dev/migrie/b/snap-padding` --- ### 📝 Commits (1) - [`7015128`](https://github.com/microsoft/terminal/commit/70151282dd6415b71cf9c0934a24c8dcc80dbd34) This seems to work, but is it as right as it could be? Does it work for the normal (non-tabs in titlebar) window? ### 📊 Changes **1 file changed** (+6 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/WindowsTerminal/NonClientIslandWindow.cpp` (+6 -0) </details> ### 📄 Description <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request When we snap across a DPI boundary, we'll get the DPI changed message _after_ the resize message. So when we try to calculate the new terminal position, we'll use the _old_ DPI to calculate the size. When snapping to a lower DPI, this means the terminal will be smaller, with "padding" all around the actual app. Instead, when we get a new DPI, force us to update out UI layout for the new DPI. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [x] Closes #2057 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [N/A] Tests added/passed <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed Snapped the terminal a bunch back and forth on my monitors. Checked this works fine for `showTabsInTitlebar: false`. Tried snapping into corners from high to low back to high DPI --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:05:36 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#24833