Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

codebytere
Copy link
Member

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.

Screenshot 2025-03-17 at 10 49 44 AM

Checklist

Release Notes

Notes: Added BrowserWindow.isSnapped() to indicate whether a given window has been arranged via Snap.

@codebytere codebytere added semver/minor backwards-compatible functionality target/36-x-y PR should also be added to the "36-x-y" branch. labels Mar 17, 2025
@codebytere codebytere force-pushed the window-snapped branch 3 times, most recently from dc4bd35 to 075335e Compare March 17, 2025 11:49
Copy link
Member

@samuelmaddock samuelmaddock left a 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
Copy link
Member

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.

docs/api/base-window.md Outdated Show resolved Hide resolved
@codebytere codebytere force-pushed the window-snapped branch 3 times, most recently from e3cec8e to 05fefc6 Compare March 18, 2025 12:16
Copy link
Member

@itsananderson itsananderson left a 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")

docs/api/base-window.md Outdated Show resolved Hide resolved
Copy link
Member

@ckerr ckerr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API LGTM

@codebytere codebytere merged commit 9ec14b9 into main Mar 24, 2025
58 checks passed
@release-clerk
Copy link

release-clerk bot commented Mar 24, 2025

Release Notes Persisted

Added BrowserWindow.isSnapped() to indicate whether a given window has been arranged via Snap.

@codebytere codebytere deleted the window-snapped branch March 24, 2025 11:09
@trop
Copy link
Contributor

trop bot commented Mar 24, 2025

I have automatically backported this PR to "36-x-y", please check out #46226

@trop trop bot added in-flight/36-x-y merged/36-x-y PR was merged to the "36-x-y" branch. and removed target/36-x-y PR should also be added to the "36-x-y" branch. in-flight/36-x-y labels Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-review/approved ✅ merged/36-x-y PR was merged to the "36-x-y" branch. semver/minor backwards-compatible functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.