Open Bug 1766068 Opened 4 years ago Updated 4 years ago

Can't use any menu after some manipulations

Categories

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

Firefox 99
defect

Tracking

()

UNCONFIRMED

People

(Reporter: go.danilll, Unassigned)

Details

Attachments

(6 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:99.0) Gecko/20100101 Firefox/99.0

Steps to reproduce:

  1. Open any site with audio output,
  2. Open SongRec (version tested: 0.3.0) and wait it to recognize track,
  3. Click "Search on YouTube" in SongRec, which will open youtube.com in Firefox,
  4. Not sure if needed, but open SongRec window, wait for new recognized track and open it again.

Actual results:

After reproduced steps context menu can be shown successfully only once. Any further context menu request will only show it for some msec and then it will be closed. In addition, extensions menu and settings menu become broken too.
This bug happens on older Firefox versions too, but only now I found steps to reproduce it.
Profiled data: https://share.firefox.dev/3v6vlXs

Expected results:

Menus should be shown by request.

Attached file about:support —

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core
Attached video demonstration.mkv —
Attached file firefox log —

(In reply to Martin Stránský [:stransky] (ni? me) from comment #5)

Can you try latest nightly?
https://fedoraproject.org/wiki/How_to_debug_Firefox_problems?rd=Bug_info_Firefox#Testing_Mozilla_binaries
Thanks.

Tried 101.0a1 with Build ID 20220427094429. The bug still happens.

Flags: needinfo?(go.danilll)

Can you please run Firefox with MOZ_LOG="WidgetPopup:5" env variable, reproduce the issue and attach the log here?
Thanks.

Flags: needinfo?(go.danilll)

(In reply to Martin Stránský [:stransky] (ni? me) from comment #7)

Can you please run Firefox with MOZ_LOG="WidgetPopup:5" env variable, reproduce the issue and attach the log here?
Thanks.

Sure. Ran the same 101.0a1, opened RMB menu two times and application menu once before Firefox opened SongRec's link.

Flags: needinfo?(go.danilll)

Please try to flip widget.wayland.use-move-to-rect key to false in about:config, restart browser and try again.
Thanks.

Flags: needinfo?(go.danilll)

(In reply to Martin Stránský [:stransky] (ni? me) from comment #9)

Please try to flip widget.wayland.use-move-to-rect key to false in about:config, restart browser and try again.
Thanks.

Err, sorry, ignore that, this is X11 one.

Flags: needinfo?(go.danilll)

We failed to grab pointer with GDK_GRAB_INVALID_TIME error - that indicates wrong window manager interaction. Which desktop is that? Can you try different desktop, like Gnome?

Flags: needinfo?(go.danilll)

(In reply to Martin Stránský [:stransky] (ni? me) from comment #11)

We failed to grab pointer with GDK_GRAB_INVALID_TIME error - that indicates wrong window manager interaction. Which desktop is that? Can you try different desktop, like Gnome?

That was Xfce 4.16 with xfwm. Also tried xfce+kwin in past, which didn't solve this problem. Now tested with Gnome 42, the bug is still reproducible.

Flags: needinfo?(go.danilll)
Priority: -- → P3

Hello,

I am the SongRec maintainer.

FYI, this reproduces since some time ago on Ubuntu 20.04 LTS with Xorg/Gnome-Shell.

The bug is triggered by this "gtk_show_uri" call: https://github.com/marin-m/SongRec/blob/9d2861d/src/gui/main_window.rs#L196

I know no other app than Firefox that happens to have menu issues after it is triggered, but am not using other Gecko apps currently.

Regards,

The problem was in timestamp of gtk::show_uri(). In details SongRec was putting Epoch time in that function and resolve is to use gtk::get_current_event_time(), which returns system uptime in msec. After some testing I found out that if timestamp is larger than one returned by gtk::get_current_event_time(), then this bug happens.
The main problem here is how Firefox handles the wrong number, becoming unusable. Something wrong with handling requests "from the future", which can happen with other programs too, not only with SongReq.

In addition I tried to set timestamp to gtk::get_current_event_time() + 2 minutes. So bug become reproducible only for this 2 minutes, and after menus start to appear again.

That's interesting, Thanks. I'm happy to review any patch for it!

Attached patch patch — — Splinter Review

Now it seems that this is not a Firefox bug, but the gtk logic. Not sure which is better: GetLastUserInputTime() rework or this little patch. It may also be worth writing warning about an incorrect value to the log.
Tested on a Firefox Nightly 103.0a1 built with this instructions https://firefox-source-docs.mozilla.org/setup/linux_build.html#building-firefox-on-linux

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

Attachment

General

Creator:
Created:
Updated:
Size: