Closed Bug 563329 Opened 15 years ago Closed 15 years ago

Add a preference to enable/disable click hold context menus

Categories

(Firefox for Android Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: vingtetun, Assigned: vingtetun)

References

(Depends on 1 open bug)

Details

Attachments

(1 file, 5 obsolete files)

Attached patch Patch (obsolete) — Splinter Review
Actually the maemo version of Fennec use click hold context menus to be able to show a context menus during a long touch (equivalent of a long left click). It would be nice to be able to simulate that on desktop. Also the current duration before showing the context menus is hard coded, but 500ms is fine on desktop but it is too short on device.
This patch use a pref instead of a configure option
Attachment #443077 - Attachment is obsolete: true
Attachment #443090 - Flags: review?(Olli.Pettay)
Comment on attachment 443090 [details] [diff] [review] Patch v0.2 - use a pref instead of a configure option If the nits mentioned on IRC are fixed.
Attachment #443090 - Flags: review?(Olli.Pettay) → review+
...so, use AddObserver. And please add some tests if there aren't any tests for this code.
Attached patch patch v0.2 - Fix nits (obsolete) — Splinter Review
This patch fix nits from IRC.
Assignee: nobody → 21
(In reply to comment #3) > ...so, use AddObserver. And please add some tests if there aren't any > tests for this code. I'm looking for tests. Thanks for your quick reply.
Attached patch patch v0.2 - Fix nits (obsolete) — Splinter Review
I've left an error in the previous patch. Tests will come.
Attachment #443095 - Attachment is obsolete: true
Attached patch Patch + tests (obsolete) — Splinter Review
Updated patch + tests. I've send it to tryserver.
Attachment #443090 - Attachment is obsolete: true
Attachment #443110 - Attachment is obsolete: true
Comment on attachment 443320 [details] [diff] [review] Patch + tests I've updated the patch on trunk and also i've changed the prefs in all.js compare to the previous patch just to be sure it is disabled by default on all platforms. Everything went fine on try server.
Attachment #443320 - Flags: review?(Olli.Pettay)
Comment on attachment 443320 [details] [diff] [review] Patch + tests > void > nsEventStateManager::BeginTrackingDragGesture(nsPresContext* aPresContext, > nsMouseEvent* inDownEvent, > nsIFrame* inDownFrame) > { >+ NS_ASSERTION(inDownEvent->widget, "aEvent-widget is null"); >+ This assertion is useless. We crash if ->widget is null. Do you really need to use so many timeouts in the test. That looks pretty error-prone. Couldn't you just add event listeners and if contextmenu etc is dispatched, then the test passes?
Blocks: 563957
Attached patch PatchSplinter Review
(In reply to comment #9) > (From update of attachment 443320 [details] [diff] [review]) > > > void > > nsEventStateManager::BeginTrackingDragGesture(nsPresContext* aPresContext, > > nsMouseEvent* inDownEvent, > > nsIFrame* inDownFrame) > > { > >+ NS_ASSERTION(inDownEvent->widget, "aEvent-widget is null"); > >+ > This assertion is useless. We crash if ->widget is null. > I've changed it with a check on widget, otherwise we crash if the event is generated using nsIDOMWindowUtils.dispatchDOMEventViaPresShell because inDownEvent->widget is null and we are using it to get the coordinate right after. > > Do you really need to use so many timeouts in the test. That looks > pretty error-prone. Couldn't you just add event listeners and if > contextmenu etc is dispatched, then the test passes? I've rewrite the tests but I'm still keeping some setTimeout/executeSoon otherwise i'm running into some weird race conditions issue.
Attachment #443320 - Attachment is obsolete: true
Attachment #443641 - Flags: review?(Olli.Pettay)
Attachment #443320 - Flags: review?(Olli.Pettay)
Attachment #443641 - Flags: review?(Olli.Pettay) → review+
Do I need to ask a sr for the patch?
removing checkin-needed until c#11 is answered in some way.
Keywords: checkin-needed
(In reply to comment #11) > Do I need to ask a sr for the patch? no
Keywords: checkin-needed
(In reply to comment #13) > (In reply to comment #11) > > Do I need to ask a sr for the patch? > > no Thanks. I'll land it tomorrow if possible.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Summary: Add a configure option to enable click hold context menus on desktop → Add a preference to enable/disable click hold context menus
Depends on: 572327
disabled the test and filed Bug 572327 due to timeouts.
Keywords: checkin-needed
verified FIXED on build: Mozilla/5.0 (X11; U; Linux armv71; Nokia N900; en-US; rv:1.9.3a6pre) Gecko/2010621 Namoroka/3.7a6pre Fennec/2.0a1pre
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: