-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
REGRESSION (266610@main): Catalyst WKWebView does not dispatch contextmenu
on right click
#22620
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EWS run on current version of this PR (hash 9e5039d) |
hortont424
approved these changes
Jan 10, 2024
megangardner
approved these changes
Jan 10, 2024
aprotyas
reviewed
Jan 10, 2024
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.
LGTM
Thanks for the reviews! |
β¦xtmenu` on right click https://bugs.webkit.org/show_bug.cgi?id=267361 rdar://119634050 Reviewed by Megan Gardner and Tim Horton. After my refactoring in 266610@main, we no longer dispatch `contextmenu` events when right clicking in Mac Catalyst `WKWebView`. This is because UIKit's gesture environment skips over the new `WKMouseTouchGestureRecognizer` when delivering events to all gesture recognizers on the window, which in turn means that `-[WKMouseTouchGestureRecognizer touchesBegan:withEvent:]` never gets triggered and we don't dispatch any mouse (or context menu) events to the page. This is due to UIKit having a Catalyst-specific codepath that returns `NO` in the case where the pointer is not the primary button. Previously, we avoided this by overriding `-_shouldReceiveTouch:forEvent:recognizerView:` and returning `YES` in the case of pointer touches. Since the new `WKMouseTouchGestureRecognizer` doesn't use any SPI or IPI, this bypass no longer works. To address this, simply override the IPI method `-_defaultAllowedMouseButtons` to return both primary and secondary mouse buttons to restore shipping behavior. * Source/WebKit/UIProcess/ios/WKMouseInteraction.mm: (-[WKMouseTouchGestureRecognizer _defaultAllowedMouseButtons]): Canonical link: https://commits.webkit.org/272883@main
9e5039d
to
2b9a29c
Compare
Committed 272883@main (2b9a29c): https://commits.webkit.org/272883@main Reviewed commits have been landed. Closing PR #22620 and removing active labels. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
2b9a29c
9e5039d
π§ͺ ios-wk2-wptπ§ͺ mac-wk2