[Wayland] context menu automatically selects last entry on right click
Categories
(Core :: Widget: Gtk, defect, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox91 | --- | fixed |
People
(Reporter: salmon.remi, Assigned: stransky)
References
(Blocks 1 open bug)
Details
Attachments
(2 files, 1 obsolete file)
1.16 MB,
video/webm
|
Details | |
Bug 1661516 [Wayland] Don't use context menu shift in nsMenuPopupFrame::SetPopupPosition(), r?jhorak
48 bytes,
text/x-phabricator-request
|
Details | Review |
User Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0
Steps to reproduce:
When right clicking in the bottom right corner of the screen, the last entry of the context menu is automatically selected when releasing the right click.
Happens only under wayland; when using xwayland the context menu shows as expected.
Reproduced with firefox 80.0 and firefox nightly 82.0a1 on Fedora 32.
Actual results:
The screenshot tool show up on right click (see attached video).
Expected results:
The context menu should show up.
Comment 1•4 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Reporter | ||
Updated•4 years ago
|
Comment 2•4 years ago
|
||
Looks like the xdg_positioner is setup to open the menu in a way that the menu is only offset correctly to the right and downwards. That means when it is flipped in both x and y directions (because you open it close to the bottom right corner) the last menu element will automatically be selected.
The way to setup the xdg_positioner is to create a 1x1 "anchor rect" corresponding to the click position, and setup the anchors and gravity so that it opens downwards to the right, with the flip y and flip x hints set so that the anchor and gravity are flipped, i.e. the menu is opened upwards/leftwards outside of the same 1x1 rect.
Assignee | ||
Updated•4 years ago
|
Reporter | ||
Comment 4•4 years ago
|
||
A workaround/fix could be to disable right click actions on the context menu itself maybe?
Right now right clicking on an entry of the context menu activates that entry (not useful/necessary and triggers this bug).
Looking at the main "hamburger" menu, right clicking on an entry does nothing (as expected).
Comment 5•4 years ago
|
||
To flip context menu correctly near the monitor edge we need to use
correct gravity and anchor of 2x2 size for the gdk_window_move_to_rect.
Updated•4 years ago
|
Comment 6•4 years ago
|
||
The fix does not deal with the font scaling != 1. (ie. 1.25, or 1.5) when rounding errors happens and the popup is repositioned due to this. Followup bug 1708709.
Comment 8•4 years ago
|
||
bugherder |
I think bug 1701877 is a dupe.
Assignee | ||
Comment 10•4 years ago
|
||
Please backout this bug. It causes popup regressions and we need to think about it.
Comment 11•4 years ago
|
||
Backed out for causing popup regressions.
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Comment 12•4 years ago
|
||
The bug is not just is which direction the menu draw but also that right clic randomly opens a "dynamic menu".
The menu closes if you release right clic.
If you keep right clic clicked and move the mouse on the menu entry you want, releasing right clic select that entry.
Sometimes, a static menu is open as expected, releasing right clic keep the menu open and you can select what you want.
Assignee | ||
Comment 13•4 years ago
|
||
Let's fix that when Bug 1710436 lands.
Assignee | ||
Comment 14•4 years ago
|
||
Can you please test latest nightly under Wayland? A new popup handling code landed there.
Thanks.
Reporter | ||
Comment 15•4 years ago
|
||
(In reply to Martin Stránský [:stransky] (ni? me) from comment #14)
Can you please test latest nightly under Wayland? A new popup handling code landed there.
Thanks.
This issue is still present under Wayland in nightly 91.0a1 (2021-06-04) (64-bit).
Assignee | ||
Comment 16•4 years ago
|
||
Updated•4 years ago
|
Comment 18•4 years ago
|
||
Comment 19•4 years ago
|
||
Backed out for causing build bustages on nsMenuPopupFrame.cpp.
Backout link: https://hg.mozilla.org/integration/autoland/rev/8601975ad8323b5f8ff07920f505f0c02fd2bd55
Failure log: https://treeherder.mozilla.org/logviewer?job_id=342713279&repo=autoland&lineNumber=26363
Assignee | ||
Comment 20•4 years ago
|
||
Updated, thanks. try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=405cc8b05038bd42f7f1747b541742e160a679ad
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Comment 21•4 years ago
|
||
Comment 22•4 years ago
|
||
bugherder |
Updated•4 years ago
|
Description
•