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

trop[bot]
Copy link
Contributor

@trop trop bot commented Mar 28, 2025

Backport of #45138

See that PR for details.

Notes: Added support for Autofill, Writing Tools and Services macOS level menu items in context menus via the new frame option in menu.popup

* feat: add support for associating a Menu with a WebFrameMain

This allows certain OS level features to activate such as Writing Tools, Autofill.. and Services.

There appears to be a bug in macOS where the responder chain isn't traversed if the menu is not popped up using an event, as such we spoof a fake mouse event at the write coordinates in the right window and use that to open the menu.

* build: fix build on non-mac

* build: oops missed a header

* fix: safely handle optional T* by checking nullptr too

* build: fix gn check and build errors

* docs: suggested changes

* feat: default `frame` to `window.webContents.mainFrame` when possible

* fix: avoid deref nullptr view

* Revert "feat: default `frame` to `window.webContents.mainFrame` when possible"

This reverts commit 2e88836.

* fix: lint

* Remove redundant scoped objects

This code, including the comments, matches almost exactly the behavior of this argument to the function.

* Add ScopedPumpMessagesInPrivateModes patch

* More null pointer safety

---------

Co-authored-by: clavin <clavin@electronjs.org>

Co-authored-by: Samuel Attard <sam@electronjs.org>
@trop trop bot requested a review from a team as a code owner March 28, 2025 18:50
@trop trop bot requested review from a team and MarshallOfSound March 28, 2025 18:50
@trop trop bot added 36-x-y backport This is a backport PR backport/requested 🗳 semver/minor backwards-compatible functionality labels Mar 28, 2025
@ckerr ckerr merged commit e2b9ced into 36-x-y Apr 1, 2025
62 checks passed
@ckerr ckerr deleted the trop/36-x-y-bp-feat-add-support-for-associating-a-menu-with-a-webframemain-1743187813526 branch April 1, 2025 14:00
@release-clerk
Copy link

release-clerk bot commented Apr 1, 2025

Release Notes Persisted

Added support for Autofill, Writing Tools and Services macOS level menu items in context menus via the new frame option in menu.popup

@ckerr
Copy link
Member

ckerr commented Apr 1, 2025

Oof, I should not have merged this when it was still in backport-requested state. Commenting about it in #wg-releases-backport-requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

36-x-y backport/requested 🗳 backport This is a backport PR semver/minor backwards-compatible functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

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