-
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
Account for the window borders when restoring from fullscreen #10737
Conversation
// We want to make sure the window is restored within the bounds of the | ||
// monitor we're on, but it's totally fine if the invisible borders are | ||
// outside the monitor. | ||
rcWorkAdjusted.left -= ncSize.width<long>() / 2; |
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.
The optimizer will probably catch it... but I'm not a huge fan of doing the division twice...
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.
meh, okay
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 mean whatever. I'm not your mom.
{ | ||
OffsetRect(&rcRestore, rcWork.left - rcRestore.left, 0); | ||
OffsetRect(&rcRestore, rcWorkAdjusted.left - rcRestore.left, 0); |
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.
This fails to work properly if rcRestore
covers a larger area than rcWorkAdjusted
doesn't it? Is that alright?
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 think so... I think the way it already was, the whole point was clipping rcRestore
inside of rcWork
. So I think it only ever did something when rcWork
was smaller than rcRestore
.
Now we're just making rcWork
a little bigger, so we can keep the invisible borders off the monitor
No automerge so Mike can decide whether I am or am not his mom and also respond to Leonard's comment. |
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 (
|
## Summary of the Pull Request When we're restoring from fullscreen, we do a little adjustment to make sure to clamp the window bounds within the bounds of the active monitor. We unfortunately didn't account for the size of the non-client area (the invisible borders around our 1px border). This didn't matter most of the time, but if the window was within ~8px of the side of the monitor (any side), then restoring from fullscreen would actually move it to the wrong place. As it turns out, the `_quake` window is within ~8px of the edges of the monitor _very often_. ## References * regressed in #9737 ## PR Checklist * [x] Closes #10199 * [x] I work here * [ ] Tests added/passed * [n/a] Requires documentation to be updated ## Validation Steps Performed The repro in the bug was fairly straightforward. It doesn't happen anymore.
🎉 Handy links: |
🎉 Handy links: |
Summary of the Pull Request
When we're restoring from fullscreen, we do a little adjustment to make sure to clamp the window bounds within the bounds of the active monitor. We unfortunately didn't account for the size of the non-client area (the invisible borders around our 1px border). This didn't matter most of the time, but if the window was within ~8px of the side of the monitor (any side), then restoring from fullscreen would actually move it to the wrong place.
As it turns out, the
_quake
window is within ~8px of the edges of the monitor very often.References
PR Checklist
Validation Steps Performed
The repro in the bug was fairly straightforward. It doesn't happen anymore.