Support double click
Categories
(GeckoView :: General, enhancement)
Tracking
(firefox128 fixed)
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.
Assignee | ||
Comment 1•6 months ago
|
||
Do you have an example for this issue?
Comment 2•6 months ago
|
||
I've thought of two usecases.
- Double click on text to select on the text.
- 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.
Comment 3•6 months ago
|
||
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.
Assignee | ||
Comment 4•5 months ago
|
||
Thank you. I see, I confirm this by https://domeventviewer.com/mouse-event-viewer.html. We have to emulate double click like Windows.
Assignee | ||
Comment 5•5 months ago
|
||
Comment 6•5 months ago
|
||
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:
- 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
Comment 7•5 months ago
|
||
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.
Updated•5 months ago
|
Assignee | ||
Comment 8•5 months ago
|
||
(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.
Comment 9•5 months ago
|
||
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.
Comment 10•5 months ago
|
||
Assignee | ||
Comment 11•5 months ago
|
||
I guess that event->mClickCount
isn't 2 on mouseup. If not 2, dblclick isn't dispatch by ESM.
Assignee | ||
Comment 12•5 months ago
•
|
||
ESM means Event State Manager.
Comment 13•5 months ago
|
||
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 ....
Assignee | ||
Comment 14•5 months ago
|
||
Actually, GTK and macOS can support more 2 clicks as native. So we should increment click count if emulated.
Comment 15•5 months ago
|
||
Interesting discussion: https://github.com/linebender/druid/issues/859
Assignee | ||
Comment 16•5 months ago
|
||
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.
Comment 17•5 months ago
|
||
Comment 18•5 months ago
|
||
bugherder |
Description
•