-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Prevent the quake window's borders from hanging onto adjacent monitors #10676
Conversation
const til::point origin{ | ||
::base::ClampSub<long>(nearestMonitorInfo.rcWork.left, (ncSize.width() / 2)), | ||
::base::ClampSub<long>(nearestMonitorInfo.rcWork.left, (ncSize.width() / 2)) + 1, |
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 really don't understand what this code is doing here. I'll approve it because it quite obviously can't break anything, but I fail to understand why we need to subtract half of ncSize. ncSize is the desktop size, minus the size of the window right? So why isn't this just set to nearestMonitorInfo.rcWork.left
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.
ncSize is the size of the Window's invisible 8-pixel borders 😄 (except it's not always 8, and it isn't uniform)
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.
so we want to adjust based on the size of the invisible portion of the window border
Hello @DHowett! 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 (
|
microsoft#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: microsoft#8888 ## PR Checklist * [x] Closes microsoft#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.
## Summary of the Pull Request Turns out, we'd only ever use the non-client size to calculate the size of the window, but not the actual position. As we learned in #10676, the nonclient area extends a few pixels past the visible borders of the window. ## PR Checklist * [x] Closes #10583 * [x] I work here * [ ] Tests added/passed * [n/a] Requires documentation to be updated ## Validation Steps Performed * [x] Works with the `IslandWindow` * [x] Works with the `NonClientIslandWindow`
#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.
## Summary of the Pull Request Turns out, we'd only ever use the non-client size to calculate the size of the window, but not the actual position. As we learned in #10676, the nonclient area extends a few pixels past the visible borders of the window. ## PR Checklist * [x] Closes #10583 * [x] I work here * [ ] Tests added/passed * [n/a] Requires documentation to be updated ## Validation Steps Performed * [x] Works with the `IslandWindow` * [x] Works with the `NonClientIslandWindow`
🎉 Handy links: |
🎉 Handy links: |
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
PR Checklist
Validation Steps Performed
It happened before, it doesn't anymore.