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
feat: enable window controls overlay on macOS #29253
Conversation
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.
NotifyLayoutWindowControlsOverlay
should also be called when SetWindowButtonVisibility
and SetTrafficLightPosition
are called.
befd91b
to
c8d27fe
Compare
2afae95
to
4c47634
Compare
I'm not sure whether this needs API approval, since it implements an experimental feature of Chromium, but the API looks good to me anyway. @electron/wg-api |
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.
Requesting changes just so this doesn't land in the current state, we had some offline discussions mostly revolving around the large quantity of copied code in the windows PR but both PRs should be updated to only take effect when a new "overlay" tile bar style is defined. This should not affect any existing apps.
I think the only wg-api-relevant consideration here is whether this has the potential to break existing use cases. Eventually the JS/CSS parts of this feature will be available without the blink feature flag, so it's worth considering whether a developer would want to have a hidden titlebar style without allowing the JS to set titlebar properties. I can't really imagine a compelling use case for that, so I'm 👍 from an API perspective. |
Co-authored-by: Samuel Attard <sam@electronjs.org>
Co-authored-by: Samuel Attard <sam@electronjs.org>
Release Notes Persisted
|
I was unable to backport this PR to "13-x-y" cleanly; |
I have automatically backported this PR to "14-x-y", please check out #29986 |
* feat: enable windows control overlay on macOS * address review feedback * chore: address review feedback * Address review feedback * update doc per review * only enable WCO when titleBarStyle is overlay * Revert "only enable WCO when titleBarStyle is overlay" This reverts commit 1b58b5b. * Add new titleBarOverlay property to manage feature * spelling fix * Update docs/api/frameless-window.md Co-authored-by: Samuel Attard <sam@electronjs.org> * Update shell/browser/api/electron_api_browser_window.cc Co-authored-by: Samuel Attard <sam@electronjs.org> * update per review feedback Co-authored-by: Samuel Attard <sam@electronjs.org> (cherry picked from commit 1f8a46c)
* feat: enable windows control overlay on macOS * address review feedback * chore: address review feedback * Address review feedback * update doc per review * only enable WCO when titleBarStyle is overlay * Revert "only enable WCO when titleBarStyle is overlay" This reverts commit 1b58b5b. * Add new titleBarOverlay property to manage feature * spelling fix * Update docs/api/frameless-window.md Co-authored-by: Samuel Attard <sam@electronjs.org> * Update shell/browser/api/electron_api_browser_window.cc Co-authored-by: Samuel Attard <sam@electronjs.org> * update per review feedback Co-authored-by: Samuel Attard <sam@electronjs.org>
* feat: enable windows control overlay on macOS * address review feedback * chore: address review feedback * Address review feedback * update doc per review * only enable WCO when titleBarStyle is overlay * Revert "only enable WCO when titleBarStyle is overlay" This reverts commit 1b58b5b. * Add new titleBarOverlay property to manage feature * spelling fix * Update docs/api/frameless-window.md Co-authored-by: Samuel Attard <sam@electronjs.org> * Update shell/browser/api/electron_api_browser_window.cc Co-authored-by: Samuel Attard <sam@electronjs.org> * update per review feedback Co-authored-by: Samuel Attard <sam@electronjs.org> (cherry picked from commit 1f8a46c)
* feat: enable windows control overlay on macOS * address review feedback * chore: address review feedback * Address review feedback * update doc per review * only enable WCO when titleBarStyle is overlay * Revert "only enable WCO when titleBarStyle is overlay" This reverts commit 1b58b5b. * Add new titleBarOverlay property to manage feature * spelling fix * Update docs/api/frameless-window.md Co-authored-by: Samuel Attard <sam@electronjs.org> * Update shell/browser/api/electron_api_browser_window.cc Co-authored-by: Samuel Attard <sam@electronjs.org> * update per review feedback Co-authored-by: Samuel Attard <sam@electronjs.org> (cherry picked from commit 1f8a46c)
* feat: enable window controls overlay on macOS (#29253) * feat: enable windows control overlay on macOS * address review feedback * chore: address review feedback * Address review feedback * update doc per review * only enable WCO when titleBarStyle is overlay * Revert "only enable WCO when titleBarStyle is overlay" This reverts commit 1b58b5b. * Add new titleBarOverlay property to manage feature * spelling fix * Update docs/api/frameless-window.md Co-authored-by: Samuel Attard <sam@electronjs.org> * Update shell/browser/api/electron_api_browser_window.cc Co-authored-by: Samuel Attard <sam@electronjs.org> * update per review feedback Co-authored-by: Samuel Attard <sam@electronjs.org> (cherry picked from commit 1f8a46c) * feat: enable windows control overlay on Windows (#30678) cherry-picked from 41646d1 Co-Authored-By: Michaela Laurencin <35157522+mlaurencin@users.noreply.github.com> Co-authored-by: Michaela Laurencin <35157522+mlaurencin@users.noreply.github.com> * modify included header files and update patches * kick off missed ci * fix lint error * chore: update patches * chore: update patches * remove version control marker * correct `resizeable_` backport Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com> Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
Description of Change
This PR adds a new property
titleBarOverlay
toBrowserWindow
on macOS to support Window Controls Overlay. On macOS, when using a frameless window in conjunction withwin.setWindowButtonVisibility(true)
or using atitleBarStyle
so that the traffic lights are visible, this property enables the Window Controls Overlay JavaScript APIs and CSS Environment Variables will be available for developers to use to better style custom titlebars.There will be another PR forthcoming that will enable this capability on Windows. Windows needs
NativeWindow::SetWindowControlsOverlayRect(const gfx::Rect& overlay_rect)
, but this newly added method is not used on macOS.Checklist
npm test
passesRelease Notes
Notes: Added support for Windows Control Overlay on macOS.