Skip to content
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

fix: ensure context-menu emitted for draggable regions #44761

Merged
merged 2 commits into from
Nov 22, 2024

Conversation

codebytere
Copy link
Member

@codebytere codebytere commented Nov 20, 2024

Description of Change

Closes #44386.
Refs #41256

Fixes an issue where the webContents context-menu event was not emitted when using -webkit-app-region: drag. This was happening after the sibling view change above because sendEvent in NativeWidgetMacNSWindow no longer sent the right-click event to the correct NSView. We can fix this by intercepting the event in sendEvent on ElectronNSWindow, which inherits from NativeWidgetMacNSWindow. This solution avoids patching.

cc @bpasero

Checklist

Release Notes

Notes: Fixed an issue where the webContents context-menu event was not emitted when using -webkit-app-region: drag.

@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Nov 20, 2024
Copy link
Member

@deepak1556 deepak1556 left a comment

Choose a reason for hiding this comment

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

Thanks!

@codebytere codebytere added semver/patch backwards-compatible bug fixes target/32-x-y PR should also be added to the "32-x-y" branch. target/33-x-y PR should also be added to the "33-x-y" branch. target/34-x-y PR should also be added to the "34-x-y" branch. labels Nov 22, 2024
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Nov 22, 2024
@codebytere codebytere merged commit 86e4529 into main Nov 22, 2024
61 checks passed
Copy link

release-clerk bot commented Nov 22, 2024

Release Notes Persisted

Fixed an issue where the webContents context-menu event was not emitted when using -webkit-app-region: drag.

@trop
Copy link
Contributor

trop bot commented Nov 22, 2024

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

@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 Nov 22, 2024
@trop
Copy link
Contributor

trop bot commented Nov 22, 2024

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

@trop
Copy link
Contributor

trop bot commented Nov 22, 2024

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

@trop trop bot added in-flight/34-x-y in-flight/33-x-y and removed target/34-x-y PR should also be added to the "34-x-y" branch. target/33-x-y PR should also be added to the "33-x-y" branch. in-flight/33-x-y labels Nov 22, 2024
@trop trop bot added merged/33-x-y PR was merged to the "33-x-y" branch. merged/34-x-y PR was merged to the "34-x-y" branch. merged/32-x-y PR was merged to the "32-x-y" branch. and removed in-flight/34-x-y in-flight/32-x-y labels Nov 22, 2024
michal-pichlinski-openfin added a commit to michal-pichlinski-openfin/electron that referenced this pull request Nov 25, 2024
)

It is no longer needed when using `views::WebView`, which fixes
the issue in the `InspectableWebContentsView::OnMousePressed`
by temporarily pretending that the WebContents is fully non-draggable.
@lslzl3000
Copy link

is this issue related to #44887?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged/32-x-y PR was merged to the "32-x-y" branch. merged/33-x-y PR was merged to the "33-x-y" branch. merged/34-x-y PR was merged to the "34-x-y" branch. semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] unable to get context-menu event when using -webkit-app-region: drag
4 participants