-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recalculate quake window size when snapping across monitors #10744
Conversation
… into dev/migrie/b/snapping-quake-window
…a smaller size. Maybe we shouldn't SetWindowPos in WM_WINDOWPOSCHANGING at all?
Co-authored-by: Dustin L. Howett <duhowett@microsoft.com>
Hello @zadjii-msft! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
if (til::rectangle{ proposedInfo.rcMonitor } != | ||
til::rectangle{ currentInfo.rcMonitor }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe you have to wrap these structs first. You should be able to compare them directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uhg, it doesn't let me do that 😕 I didn't really feel like manually comparing each of .left
, .top
, etc, and this isn't going to be a particularly hot path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I just wrote it because I thought it might make the code simpler. ^^
## 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
🎉 Handy links: |
🎉 Handy links: |
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:Validation Steps Performed