forked from microsoft/terminal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add snap-layouts support to the Terminal (microsoft#11680)
Adds snap layout support to the Terminal's maximize button. This PR is full of BODGY, so brace yourselves. Big thanks to Chris Swan in microsoft#11134 for building the prototype. I don't believe this solves microsoft#8795, because XAML islands can't get nchittest messages - The window procedure for the drag bar forwards clicks on its client area to its parent as non-client clicks. - BODGY: It also _manually_ handles the caption buttons. They exist in the titlebar, and work reasonably well with just XAML, if the drag bar isn't covering them. - However, to get snap layout support, we need to actually return `HTMAXBUTTON` where the maximize button is. If the drag bar doesn't cover the caption buttons, then the core input site (which takes up the entirety of the XAML island) will steal the `WM_NCHITTEST` before we get a chance to handle it. - So, the drag bar covers the caption buttons, and manually handles hovering and pressing them when needed. This gives the impression that they're getting input as they normally would, even if they're not _really_ getting input via XAML. - We also need to manually display the button tooltips now, because XAML doesn't know when they've been hovered for long enough. Hence, the `_displayToolTip` `ThrottledFuncTrailing` ## Validation Minimized, maximized, restored down, hovered the buttons slowly, moved the mouse over them quickly, they feel the same as before. But now with snap layouts appearing. ## TODO! * [x] I'm working on getting the ToolTips on the caption buttons back. Alas, I needed a demo of this _today_, so I'll fix that tomorrow morning. * [x] mild concern: I should probably test Win 10 to make sure there wasn't weird changes to the message loop in win11 that means this is broken on win10. * [x] I think I used the wrong issue number for tons of my comments throughout this PR. Double check that. Should be microsoft#9443, not microsoft#9447. Closes microsoft#9443 I thought this took care of microsoft#8587 ~as a bonus, because I was here, and the fix is _now_ trivial~, but looking at the latest commit that regressed. Co-authored-by: Chris Swan <chswan@microsoft.com>
- Loading branch information
1 parent
a9c2db4
commit f2ebb21
Showing
11 changed files
with
454 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.