Closed Bug 1759952 Opened 4 years ago Closed 10 days ago

Some Context Menu Items Don't Work With Native GTK Context Menus

Categories

(Core :: Widget: Gtk, defect, P3)

Firefox 100
defect

Tracking

()

RESOLVED FIXED
159 Branch
Tracking Status
firefox100 --- wontfix
firefox159 --- fixed

People

(Reporter: lolrepeatlol, Assigned: sinker)

References

Details

Attachments

(2 files)

Seemingly random context menu items don't work with native GTK menus.

Notably, copying and pasting text for example doesn't work. Save Page As... does not open a window to save the page. Still, other items like Reload work fine.

One thing I noticed was that while copying in the URL bar works, copying in webpages does not.

Attached is a (somewhat confusing, apologies) video of me trying various things with the GTK native context menus. Hopefully it gets the idea across

Blocks: 1757402

I tried this, Send Page to Device is broken. also it is showing Back and Forward as text instead of Icons.

Please attach your about:support.
Thanks.

Flags: needinfo?(lolrepeatlol)
Flags: needinfo?(suraj.ghimire7)

This is expected, those menus need more work.

Flags: needinfo?(suraj.ghimire7)
Flags: needinfo?(lolrepeatlol)

The menu presenting Back and Forward as text instead of Icons is desirable. Some of my grandparents really struggle to ascertain what your obscure iconography is, and for the sake of consistency and accessibility (think screen-readers) they should remain as text. No benefits are gained by their current implementation.

Pela primeira vez decidi usar o widget.gtk.native-context-menus e acabo de encarar o mesmo problema.
Do menu context, de todas apções as unicas que funcionam são:

  • Select All

For the first time I decided to use widget.gtk.native-context-menus, and I just faced the same problem.
From the context menu, of all the options, the only ones that work are:

"Select All" and any option added by extensions

Btw, sorry for the latest incomplete portuguese message.

#c6

cleomenezesjr@gmail.com, I don't think you need to apologize. We have access to translators. It is a shame that this feature hasn't seen much improvement.

Priority: -- → P3

Okay, two years later, reviving this issue by testing with latest Nightly 158.0a1 shows that GTK native context menus are still not functioning correctly.

https://share.firefox.dev/4yjz5Du

It can be very easily reproduced by attempting to right click on a tab and trying to select an option in the context menu will do absolutely nothing.

Lemme test with all add-ons disabled, and see if it changes anything...

https://share.firefox.dev/4Avq6Au

...Annnnnnd nope! Still doesn't. Unfortunately...

Possibly some line of code overriding the GTK native context menu event, perhaps?

Severity: -- → S3

Please try this build to see if it works.
The menu has closed before running the command of the selected item.
It causes the command fails to run.
This build delays menu closing, and it should fix the issue.

[1] https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/VJW3_QsCTQ2BttR1i9Br1Q/runs/0/artifacts/public/build/target.tar.xz

Flags: needinfo?(silverriolu)

(In reply to Thinker Li [:sinker] from comment #9)

Please try this build to see if it works.
The menu has closed before running the command of the selected item.
It causes the command fails to run.
This build delays menu closing, and it should fix the issue.

[1] https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/VJW3_QsCTQ2BttR1i9Br1Q/runs/0/artifacts/public/build/target.tar.xz

https://share.firefox.dev/4rtqwTI

Looks to me like the native GTK context menus are now working perfectly as intended in this build, seems ready to be merged into Nightly. Awesome work!

Flags: needinfo?(silverriolu)

GTK unmaps a menu before it activates the chosen item, so
NativeMenuGtk::OnUnmap() fired popuphiding and popuphidden before the item's
command ran. The hiding handlers tear down what the command needs: the
content area context menu sets gContextMenu to null (Copy Link, Save Page As
throw), the tab context menu clears contextTab, and in a text field the
removed spell check items rebuild the menu model, dropping the action of the
item being activated (Copy and Paste do nothing).

Fire the events from a runnable instead, so the command runs first, as it
does for XUL menus. Close() fires them right away, since a close requested by
code activates no item and the popup manager may show a new menu for the same
element right after it.

Assignee: nobody → thinker.li
Status: NEW → ASSIGNED
Pushed by thinker.li@gmail.com: https://github.com/mozilla-firefox/firefox/commit/635794860d63 https://hg.mozilla.org/integration/autoland/rev/12b75ec0bc83 [GTK] Run a native menu item's command before popuphiding r=stransky,gtk-reviewers,emilio
Status: ASSIGNED → RESOLVED
Closed: 10 days ago
Resolution: --- → FIXED
Target Milestone: --- → 159 Branch
QA Whiteboard: [qa-triage-done-c160/b159]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: