Skip to content

fix: system-context-menu with frameless BrowserWindows - #43243

Merged
codebytere merged 1 commit into
mainfrom
fix-prevent-default-menu-win
Aug 9, 2024
Merged

codebytere merged 1 commit into
mainfrom
fix-prevent-default-menu-win

Conversation

@codebytere

@codebytere codebytere commented Aug 7, 2024 •

Copy link
Copy Markdown
Member

Description of Change

Closes #37614
Closes #26726
Closes #24893

Fixes an issue where system-context-menu was not triggered as expected on Windows when using a frameless BrowserWindow. As noted by @ckerr in the above issue, Electron never sees the WM_CONTEXTMENU message because hwnd_message_handler.cc uses its own custom event handling for WM_RBUTTONUP. We can fix this by intercepting it in NativeWindowViews::PreHandleMSG, as suggested here by @eXhumer. Confirmed to address the issue with a local build and test.

Checklist

Release Notes

Notes: Fixed an issue where system-context-menu was not triggered as expected on Windows when using a frameless BrowserWindow.

@codebytere codebytere added semver/patch backwards-compatible bug fixes target/32-x-y PR should also be added to the "32-x-y" branch. labels Aug 7, 2024
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Aug 7, 2024
@codebytere
codebytere force-pushed the fix-prevent-default-menu-win branch from a932960 to f35b7bb Compare August 7, 2024 09:50
@codebytere codebytere changed the title fix: system-context-menu with frameless windows @codebytere fix: system-context-menu with frameless BrowserWindows Aug 7, 2024
@codebytere codebytere changed the title @codebytere fix: system-context-menu with frameless BrowserWindows fix: system-context-menu with frameless BrowserWindows Aug 7, 2024
@eXhumer

eXhumer commented Aug 7, 2024 •

Copy link
Copy Markdown

Recommend closing #24893 as well, related issue. See #24893 (comment)

@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Aug 8, 2024
@codebytere
codebytere merged commit 0718c2b into main Aug 9, 2024
@release-clerk

release-clerk Bot commented Aug 9, 2024

Copy link
Copy Markdown

Release Notes Persisted

Fixed an issue where system-context-menu was not triggered as expected on Windows when using a frameless BrowserWindow.

@codebytere
codebytere deleted the fix-prevent-default-menu-win branch August 9, 2024 08:08
@trop

trop Bot commented Aug 9, 2024

Copy link
Copy Markdown
Contributor

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

@trop trop Bot added in-flight/32-x-y and removed target/32-x-y PR should also be added to the "32-x-y" branch. labels Aug 9, 2024
@codebytere

Copy link
Copy Markdown
Member Author

/trop run backport-to 31-x-y,30-x-y

@trop

trop Bot commented Aug 9, 2024

Copy link
Copy Markdown
Contributor

The backport process for this PR has been manually initiated - sending your PR to 31-x-y!

@trop

trop Bot commented Aug 9, 2024

Copy link
Copy Markdown
Contributor

The backport process for this PR has been manually initiated - sending your PR to 30-x-y!

@trop

trop Bot commented Aug 9, 2024

Copy link
Copy Markdown
Contributor

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

@trop

trop Bot commented Aug 9, 2024

Copy link
Copy Markdown
Contributor

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

@trop trop Bot added the in-flight/30-x-y label Aug 9, 2024
@trop trop Bot added merged/32-x-y PR was merged to the "32-x-y" branch. merged/30-x-y PR was merged to the "30-x-y" branch. merged/31-x-y PR was merged to the "31-x-y" branch. and removed in-flight/32-x-y in-flight/30-x-y in-flight/31-x-y labels Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged/30-x-y PR was merged to the "30-x-y" branch. merged/31-x-y PR was merged to the "31-x-y" branch. merged/32-x-y PR was merged to the "32-x-y" branch. semver/patch backwards-compatible bug fixes

Projects

None yet

4 participants