NEW 272354
[WPE] Right mouse button click stops further mouse button processing
https://bugs.webkit.org/show_bug.cgi?id=272354
Summary [WPE] Right mouse button click stops further mouse button processing
Adrian Perez
Reported 2024-04-08 14:40:05 PDT
Steps to reproduce: - Open any web page in a WPE browser that has code to handle the right mouse button. For example Cog with this patch: https://github.com/Igalia/cog/pull/704/ - Right click anywhere on the page - Try to click elsewhere. Outcome: Mouse buttons stop working. WebKit is not hung because other things like keyboard input or mouse-wheel scroll work fine. Expected: Mouse clicks continue to work after using the right mouse button.
Attachments
Add WPE context menu support (7.70 KB, patch)
2024-07-02 15:10 PDT, contact
ews-feeder: commit-queue-
Add WPE context menu support (7.70 KB, patch)
2024-10-21 20:40 PDT, contact
no flags
Add touch context menu support (8.25 KB, patch)
2024-10-22 16:51 PDT, contact
no flags
contact
Comment 1 2024-06-22 17:18:55 PDT
Some cursory research seems to suggest this is related to lack of context menu handling. My debug log is full of the following messages after right-clicking in cog: ``` WebPageProxy::processNextQueuedMouseEvent: Waiting for context menu to show. ``` Looking at the code that emits this event, it seems like it will ignore all mouse events until a context menu is opened: https://github.com/WebKit/WebKit/blob/b7c62d71ee8f97b70918f9c3b0882e0dd705e1a6/Source/WebKit/UIProcess/WebPageProxy.cpp#L3593-L3597
contact
Comment 2 2024-06-28 19:55:13 PDT
Turns out WPE WebKit had a context menu stub added in the past when some cleanup was done on the other backends, but never actually had a functioning context menu implementation from what I can tell. So this issue basically boils down to adding context menu support for WPE WebKit and as a result right-click should get fixed since it will properly emit the context menu signal.
contact
Comment 3 2024-07-02 15:10:52 PDT
Created attachment 471799 [details] Add WPE context menu support I've added a patch that seems to fix this bug and add context menu support based on some basic testing. Since it's mostly based on trial and error, I'd expect this to be pretty far from mergeable, so I'd appreciate any feedback. I wasn't able to submit it officially since the WebKit git script asked for GitHub account access, which I'm not willing to give it access to. Details about the patch in question: ``` This replaces the existing context menu stub implementation with a minimal version which emits the WebView's context menu signal. This also resolves a bug where all mouse input would break after right-clicking, since the stub implementation was waiting for the context menu to be opened before processing new mouse events. The `context-menu-dismissed` signal is removed from the WPE backend in a breaking change, since dismissal is handled by the consumer of the API. Fixes https://bugs.webkit.org/show_bug.cgi?id=265637. ```
contact
Comment 4 2024-10-21 20:40:56 PDT
Created attachment 473010 [details] Add WPE context menu support This replaces the existing context menu stub implementation with a minimal version which emits the WebView's context menu signal. This also resolves a bug where all mouse input would break after right-clicking, since the stub implementation was waiting for the context menu to be opened before processing new mouse events. The `context-menu-dismissed` signal is removed from the WPE backend in a breaking change, since dismissal is handled by the consumer of the API. Fixes https://bugs.webkit.org/show_bug.cgi?id=272354.
contact
Comment 5 2024-10-22 16:51:02 PDT
Created attachment 473013 [details] Add touch context menu support This patch uses the new WPE Platform's gesture controller to send synthetic right-click events whenever holding a touch point in position for a second. The synthetic right-click event will then automatically generate a context menu event for interested clients.
Note You need to log in before you can comment on or make changes to this bug.