-
Notifications
You must be signed in to change notification settings - Fork 16.5k
feat: add BrowserWindow.isSnapped()
#46079
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
Conversation
dc4bd35
to
075335e
Compare
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.
API LGTM
bool NativeWindowViews::IsSnapped() const { | ||
#if BUILDFLAG(IS_WIN) | ||
// IsWindowArranged() is not a part of any header file. | ||
// https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-iswindowarranged |
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.
Apparently it is in a header file, but may have led to crashes on older systems.
https://chromium-review.googlesource.com/c/chromium/src/+/5976961
Seems fine as is though.
e3cec8e
to
05fefc6
Compare
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.
API LGTM since my only readonly
question is pretty minor (and I'm guessing the answer is "no")
05fefc6
to
d23d8cb
Compare
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.
API LGTM
Release Notes Persisted
|
I have automatically backported this PR to "36-x-y", please check out #46226 |
Description of Change
This PR adds the ability for a developer to tell whether a given window has been arranged via Snap on Windows. Snap is becoming more integral to Windows window management and understanding this as a window arrangement similar to maximized or minimized is important for developers showing information to users.
See Windows Documentation for more information.
Checklist
npm test
passesRelease Notes
Notes: Added
BrowserWindow.isSnapped()
to indicate whether a given window has been arranged via Snap.