diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
commit | def92d1b8e9d373e2f6f27c366d578d97d8960c6 (patch) | |
tree | 2ef34b9ad8bb9a9220e05d60352558b15f513894 /widget/android/nsWindow.cpp | |
parent | Adding debian version 125.0.3-1. (diff) | |
download | firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.tar.xz firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'widget/android/nsWindow.cpp')
-rw-r--r-- | widget/android/nsWindow.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/widget/android/nsWindow.cpp b/widget/android/nsWindow.cpp index e9756c3f92..a654c8e848 100644 --- a/widget/android/nsWindow.cpp +++ b/widget/android/nsWindow.cpp @@ -609,6 +609,22 @@ class NPZCSupport final PostInputEvent([input = std::move(input), result](nsWindow* window) { WidgetMouseEvent mouseEvent = input.ToWidgetEvent(window); window->ProcessUntransformedAPZEvent(&mouseEvent, result); + if (MouseInput::SECONDARY_BUTTON == input.mButtonType) { + if ((StaticPrefs::ui_context_menus_after_mouseup() && + MouseInput::MOUSE_UP == input.mType) || + (!StaticPrefs::ui_context_menus_after_mouseup() && + MouseInput::MOUSE_DOWN == input.mType)) { + MouseInput contextMenu = input; + + // Actually we don't dispatch context menu event to APZ since we don't + // handle it on APZ yet. If handling it, we need to consider how to + // dispatch it on APZ thread. It may cause a race condition. + contextMenu.mType = MouseInput::MOUSE_CONTEXTMENU; + + WidgetMouseEvent contextMenuEvent = contextMenu.ToWidgetEvent(window); + window->ProcessUntransformedAPZEvent(&contextMenuEvent, result); + } + } }); switch (result.GetStatus()) { |