Open Bug 1355848 Opened 3 years ago Updated 6 months ago

Right-click automatically select first option from the menu

Categories

(Firefox :: Menus, defect)

52 Branch
defect
Not set

Tracking

()

UNCONFIRMED

People

(Reporter: phoenikso, Unassigned)

Details

Attachments

(4 files)

User Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0
Build ID: 20170403080404

Steps to reproduce:

1) Right-click link or form element
2) Release the button immediately


Actual results:

1) Menu just flickers
2) The first option from the mennu is activated


Expected results:

1) Menu appears and stays
2) I select the proper option from the menu
This happens on Fedora 25. It was not an issue on version 52.0, however it is an issue on version 52.0.2 (updated on April 7).

It happens in safe mode. It does not happen in any other application or web browser. It happens on all websites.
Screencast: http://fenikso.cz/Linux/test.gif

First click is regular right-click, e.g. click and release immediately.
Second click is right-click, hold for a while, release.
Third one is right-click, hold, move mouse to select option, release.
Additional information:

The issue manifests even in build downloaded from Mozilla page. It also exists in some of the Fedora builds of version 52.0:

firefox-52.0-1.fc25.x86_64 - and anything older - the problem is not there
firefox-52.0-4.fc25.x86_64 - and anything newer - the problem is present

It also happens on https://ftp.mozilla.org/pub/firefox/releases/52.0/linux-x86_64/en-US/firefox-52.0.tar.bz2 
It seems to be fixed in https://ftp.mozilla.org/pub/firefox/releases/53.0b9/linux-x86_64/en-US/firefox-53.0b9.tar.bz2
Hi,
My Operating System: Ubuntu 15.10 x64
Firefox Browser:Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

I worked this bug on my Firefox version and the bug could'nt be reproduced.

[bugday-20170410]
I can't reproduce this issue with the following specs:
Mozilla/5.0 (X11; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Can you try and update to the latest version of Nightly and see if you can reproduce this issue?
Component: Untriaged → Menus
Flags: needinfo?(phoenikso)
I can reproduce it with:
* https://ftp.mozilla.org/pub/firefox/nightly/2017/04/2017-04-18-10-02-13-mozilla-central/firefox-55.0a1.en-US.linux-x86_64.tar.bz2
* Mozilla/5.0 (X11; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

I cannot reproduce with:
* https://ftp.mozilla.org/pub/firefox/releases/53.0b9/linux-x86_64/en-US/firefox-53.0b9.tar.bz2
* Mozilla/5.0 (X11; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0
Flags: needinfo?(phoenikso)
Also, on versions where I have the issue, it seems that menu is placed with corner exactly at pointer point, but on versions I do not have the problem the menu is placed a few pixels bellow and to the right.
Attached image menus.png
Differences between menu placement, on the left - working version of Firefox, on the right - problematic version of Firefox.
This is fixed for me in release 53.0. However, I am bit concerned that it seems to be there again in 55.0a1.

This bug, or one very much like it, still appears to be present in:

Firefox 67.0a1
Build ID: 20190228214753
OS: Darwin 18.2.0

I have noticed that the bug is not always reproducible; I think this is because of the variability in duration between button-down and button-up events. When I browse casually, without paying much attention to my finger movements, I almost always hit this bug. However, if I focus intently, and try to minimise the time between the button-down and button-up events (i.e.: click real fast), I am sometimes able to achieve desired behaviour. In this latter case, the menu stays open.

It feels like Firefox is interpreting the button-down event as a button-hold.

The OP mentioned links and form elements. While I am able to repro on those UI elements, I think this bug extends to the entire Firefox UI, including the context menus that appear when right-clicking on a tab or a button alongside the address bar.

Unfortunately, I can't say when this bug regressed on my system. I only noticed this odd behaviour when I recently switched from Chrome to FF 67 (nightly). I have not observed this behaviour in any other application.

(In reply to sg.mozilla from comment #10)

Hi, please see bug 1504021.

I can reproduce with, and without, the title bar enabled. With the title bar enabled, the cursor position relative to the menu does not appear to change.

Perhaps there are two similar bugs here.

(In reply to sg.mozilla from comment #12)

With the title bar enabled, the cursor position relative to the menu does not appear to change.

I tried again and reproducing is not that straightforward indeed.
Can you please try these steps:

  • "Title Bar" checked; restart Firefox
  • "Title Bar" unchecked; can you reproduce the bug? If not, continue
  • Resize the window a bit; don't maximize the window; restart Firefox
  • Repeat this last step until you are able to reproduce the bug

If you can reproduce the bug, then try these steps again but with "Title Bar" checked: you shouldn't be able to reproduce the bug.

Attached image ctx-menu-title-bar.png

I was able to repro in the following cases:

Case 1:

  • Starting state: Title bar enabled
  • Restart Firefox
  • Toggle Title Bar enabled -> disabled
  • Right-click on tab (reloads tab) or within page extents (navigates back)

Case 2:

  • Starting state: Title bar disabled
  • Restart Firefox
  • Toggle Title Bar disabled -> enabled
  • Right-click on tab or within page extents

Case 3:

  • Starting state: Title bar enabled
  • Restart Firefox
  • (Title bar is still enabled. No change in state.)
  • Right-click on tab or within page extents

In all three cases, the problem was reproducible without having to resize the window.

I have attached some screen shots taken on my system that show the position of the context menu relative to the mouse cursor with and without the title bar. I'm using a trackball, so I'm confident these images were taken without inadvertent cursor movement on (right button) click.

The change in cursor -- from a hand with outstretched finger to a conventional arrow -- is curious. I get one or the other seemingly by chance. The problematic behaviour appears to strike when the cursor is a conventional arrow.

Considering your last post and this post:
https://www.linuxquestions.org/questions/slackware-14/firefox-right-click-goes-back-a-page-4175632126/#post5943972
I can suppose that the behavior really depends on the window manager. On OS X the title bar doesn't matter. On Linux+Xfce it's the only cause of the bug. On other window managers e.g. i3, the bug may not appear at all.
The bug may consistently appear on some window managers and inconsistently appear in others.

I can still easily reproduce it on Fedora 29 with i3 window manager, Greybird GTK theme, Firefox 65.0.2. I have window titles disabled and 3px border.

For a long time I use the following workaround mentioned here:
https://www.reddit.com/r/firefox/comments/672ef7/rightclick_menu_open_under_mouse_cursor/

ui.contextMenuOffsetHorizontal;5
ui.contextMenuOffsetVertical;5

(In reply to Stanislav Kontar from comment #19)

ui.contextMenuOffsetHorizontal;5
ui.contextMenuOffsetVertical;5
These variables don't seem to exist in my Firefox 66.0.3 and manually creating them has no effect.

For what it's worth, that was an effective workaround for me. With those knobs set as prescribed, I was no longer able to reproduce the problem. FF 68.0a1 (build ID 20190425220817) on Darwin 18.2.0 (macOS 10.14.3).

You need to log in before you can comment on or make changes to this bug.