Closed Bug 1837119 Opened 1 year ago Closed 5 months ago

Support double click

Categories

(GeckoView :: General, enhancement)

All
Android
enhancement

Tracking

(firefox128 fixed)

RESOLVED FIXED
128 Branch
Tracking Status
firefox128 --- fixed

People

(Reporter: jjdagdelen, Assigned: m_kato)

References

(Blocks 1 open bug, Regressed 1 open bug)

Details

Attachments

(3 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Safari/605.1.15

Steps to reproduce:

When using mouse with Android device & GeckoView-based browser, double-click.

In the past, I think this behavior was deemed to not make sense for android devices because they were primarily interacted with via touch screens. However, android devices are increasingly being used with keyboard and mouse, so mirroring the behavior of clicks on desktop when using a mouse may be desirable.

Actual results:

Double-click event not occurring.

Expected results:

Double-click event should occur.

Do you have an example for this issue?

Flags: needinfo?(jjdagdelen)

I've thought of two usecases.

  1. Double click on text to select on the text.
  2. The example in DOM dbclick event: https://developer.mozilla.org/en-US/docs/Web/API/Element/dblclick_event#result

Chrome for Android works under both usecases, but fenix couldn't.

Blocks: 1587995

Redirect a needinfo that is pending on an inactive user to the triage owner.
:owlish, since the bug has recent activity, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(jjdagdelen) → needinfo?(bugzeeeeee)

Thank you. I see, I confirm this by https://domeventviewer.com/mouse-event-viewer.html. We have to emulate double click like Windows.

Assignee: nobody → m_kato

Hi , m_kato.

I'm interested in working on this and actually i have made a WIP patch.
it would be appreciate that if you could help on solving some implementation/design questions.

Questions:

  1. I've looked into windows implementation, there's constant about time and distance to determine if it is a double click event.
    I'm not sure how these values should be in Android. Should we mimic Android's Double Tap 's value or sometime else?

Under Windows , use the os provided value: SM_CXDOUBLECLK/SM_CYDOUBLECLK and GetDoubleClickTime
Android's Double Tap: configuration.getScaledDoubleTapTouchSlop and ViewConfiguration.getDoubleTapTimeout
Or
Chromium's implementation , a fixed value in all platform? https://source.chromium.org/chromium/chromium/src/+/main:ui/events/event.cc;drc=e686c80feb21c29957282a8a4505a86b4feaca1f;bpv=1;bpt=1;l=500 and https://source.chromium.org/chromium/chromium/src/+/main:ui/events/event_constants.h;drc=f0f5f3ceebb00da9363ccc7a1e2c0f17b6b383ba;l=115

Oh, you submitted a try build just now , Good to know .

Actually, I guess the implementation might have some problem

If you quickly click on the target (for example the yellow square in https://developer.mozilla.org/en-US/docs/Web/API/Element/dblclick_event#result ) , the first dblclick event will trigger, but the second dblclick event won't. So the square won't zoom in-and-out as smoothly as it in Windows.

Flags: needinfo?(m_kato)

(In reply to jackyzy823 from comment #7)

Oh, you submitted a try build just now , Good to know .

Actually, I guess the implementation might have some problem

If you quickly click on the target (for example the yellow square in https://developer.mozilla.org/en-US/docs/Web/API/Element/dblclick_event#result ) , the first dblclick event will trigger, but the second dblclick event won't. So the square won't zoom in-and-out as smoothly as it in Windows.

I cannot reproduce your issue on Android 13 + Pixel 4a.

Flags: needinfo?(m_kato)

Hi. I attached a video to describe the problem. I'm using GeckoView_Example apk from the treeherder try.

You could observe the mouse click with the top right red "pts" block.

With real Bluetooth mouse under Pixel 6, there's only one dblclick (only zoom in) when i continuously clicking.

I also do a test under with "scrcpy --forward-all-clicks" . the result is same , and sometimes it could trigger a second dblclick (to zoom out) , but no third one.

Flags: needinfo?(m_kato)

I guess that event->mClickCount isn't 2 on mouseup. If not 2, dblclick isn't dispatch by ESM.

Flags: needinfo?(m_kato)

ESM means Event State Manager.

Yep, and the click count should not increase endlessly.

For example , under Windows, if you click very fast , the click count is basically 2 (the most) or 3, in rare cause it could be 4 ( increased twice before eMouseDoubleClick ) . In most case , the click count would be reset to 2 after eMouseDoubleClick event

In Android. there's no system mechanism like windows to emit event like WM_LBUTTONDBLCLK and etc dbclick events to help firefox resetting the click count. So ....

Actually, GTK and macOS can support more 2 clicks as native. So we should increment click count if emulated.

Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

When using mouse on GeckoView, dblclick event isn't fired. Android doesn't
have a state of double click for mouse, so we have to emulate it like
Windows widget.

The default of timeout values are from android.view.GestureDetector's double
tap.

Pushed by m_kato@ga2.so-net.ne.jp: https://hg.mozilla.org/integration/autoland/rev/1a9e42d62e96 Support double click event on GeckoView. r=geckoview-reviewers,owlish
Regressions: 1896840
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 128 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: