[PR #10744] [MERGED] Recalculate quake window size when snapping across monitors #28206

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/10744
Author: @zadjii-msft
Created: 7/21/2021
Status: Merged
Merged: 8/2/2021
Merged by: @undefined

Base: mainHead: dev/migrie/b/snapping-quake-window


📝 Commits (10+)

  • 45c6354 fixes Bug: Font size of Command Palette doesn't scale with terminal font size (#10201)
  • 48c6309 Merge remote-tracking branch 'origin/dev/migrie/b/10201-1px-of-quake' into dev/migrie/b/snapping-quake-window
  • dff7304 This is closer, but when going to a higher DPI, the island ends with a smaller size. Maybe we shouldn't SetWindowPos in WM_WINDOWPOSCHANGING at all?
  • 912d727 oh hey this works. Win+arrow is still weird, but it was always weird
  • b1ee91c This code was important
  • b681381 comments and cleanup. Fixes #10274
  • 9708166 Merge remote-tracking branch 'origin/main' into dev/migrie/b/snapping-quake-window
  • 28aa058 Update src/cascadia/WindowsTerminal/IslandWindow.cpp
  • 2fe2927 Merge remote-tracking branch 'origin/main' into dev/migrie/b/snapping-quake-window
  • 6a8b6e2 leonard nits

📊 Changes

2 files changed (+91 additions, -9 deletions)

View changed files

📝 src/cascadia/WindowsTerminal/IslandWindow.cpp (+89 -9)
📝 src/cascadia/WindowsTerminal/IslandWindow.h (+2 -0)

📄 Description

Summary of the Pull Request

win+shift+arrows can be used to move windows to adjacent monitors. When that happens, we'll new re-calculate the size of the window for the new monitor.

References

PR Checklist

Detailed Description of the Pull Request / Additional comments

In WM_WINDOWPOSCHANGING, the OS says "hey, I'm about to do {something} to your window. You cool with that?". We handle that message by:

  1. checking if the window was moved as a part of this message
  2. getting the monitor that the window will be moved onto
  3. If that monitor is different than the monitor the window is currently on, then
  • calculate how big the quake window should be on that monitor
  • tell the OS that's where we'd like to be.

Validation Steps Performed

  • win+shift+arrows works right now
  • normal quake summoning still works right

🔄 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/10744 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 7/21/2021 **Status:** ✅ Merged **Merged:** 8/2/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/migrie/b/snapping-quake-window` --- ### 📝 Commits (10+) - [`45c6354`](https://github.com/microsoft/terminal/commit/45c6354f65ecfd20e2435f19c897eb0a0b51b939) fixes #10201 - [`48c6309`](https://github.com/microsoft/terminal/commit/48c63095c082d0350c3fd09b079619a2617847b5) Merge remote-tracking branch 'origin/dev/migrie/b/10201-1px-of-quake' into dev/migrie/b/snapping-quake-window - [`dff7304`](https://github.com/microsoft/terminal/commit/dff73049ed101740c7ae064511a8dc1dcd0fd161) This is closer, but when going to a higher DPI, the island ends with a smaller size. Maybe we shouldn't SetWindowPos in WM_WINDOWPOSCHANGING at all? - [`912d727`](https://github.com/microsoft/terminal/commit/912d7271fee60924e86237bb64d55039b57921b6) oh hey this works. Win+arrow is still weird, but it was _always_ weird - [`b1ee91c`](https://github.com/microsoft/terminal/commit/b1ee91c060359a2691cc6da0847761a998be930d) This code was important - [`b681381`](https://github.com/microsoft/terminal/commit/b6813814d742a121181c2edd77d4e8df06eab813) comments and cleanup. Fixes #10274 - [`9708166`](https://github.com/microsoft/terminal/commit/97081660c24bf0b0f1b97f38d2150073a5b66e4c) Merge remote-tracking branch 'origin/main' into dev/migrie/b/snapping-quake-window - [`28aa058`](https://github.com/microsoft/terminal/commit/28aa0582515b3642e8216e94eb95222ddf72184f) Update src/cascadia/WindowsTerminal/IslandWindow.cpp - [`2fe2927`](https://github.com/microsoft/terminal/commit/2fe2927c36871897a967c5f858d45bb422637bc3) Merge remote-tracking branch 'origin/main' into dev/migrie/b/snapping-quake-window - [`6a8b6e2`](https://github.com/microsoft/terminal/commit/6a8b6e272971a039eafe3528f58cd79ec58982e3) leonard nits ### 📊 Changes **2 files changed** (+91 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/WindowsTerminal/IslandWindow.cpp` (+89 -9) 📝 `src/cascadia/WindowsTerminal/IslandWindow.h` (+2 -0) </details> ### 📄 Description ## Summary of the Pull Request <kbd>win+shift+arrows</kbd> can be used to move windows to adjacent monitors. When that happens, we'll new re-calculate the size of the window for the new monitor. ## References * megathread: #8888 ## PR Checklist * [x] Closes #10274 * [x] I work here * [ ] Tests added/passed * [n/a] Requires documentation to be updated ## Detailed Description of the Pull Request / Additional comments In `WM_WINDOWPOSCHANGING`, the OS says "hey, I'm about to do {something} to your window. You cool with that?". We handle that message by: 1. checking if the window was _moved_ as a part of this message 2. getting the monitor that the window will be moved onto 3. If that monitor is different than the monitor the window is currently on, then * calculate how big the quake window should be on that monitor * tell the OS that's where we'd like to be. ## Validation Steps Performed * <kbd>win+shift+arrows</kbd> works right now * normal quake summoning still works right --- <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:27:01 +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#28206