Closed Bug 1949914 Opened 1 year ago Closed 1 year ago

Context menus only open the first mouse click when using SW-WR

Categories

(Core :: Widget: Win32, defect)

defect

Tracking

()

VERIFIED FIXED
138 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 --- unaffected
firefox136 --- unaffected
firefox137 --- verified
firefox138 --- verified

People

(Reporter: cpeterson, Assigned: emilio)

References

(Regression)

Details

(Keywords: regression)

Attachments

(3 files, 1 obsolete file)

Attached image screenshot.png

Steps to reproduce

  1. Set pref widget.windows.mica.popups = true and restart Firefox.
  2. Right click on Firefox chrome or a web page to open a context menu.
  3. Right click a second time.

Expected result

The context menu should open again and it should list the menu items.

Actual result

The context menu opens again, but it is blank. See the attached screenshot.

If you switch to a different tab and right click there, the content menu will list the menu items as expected.

I'm running Nightly 137.0a1 (2025-02-21) on Windows 11 (24H2).

Flags: needinfo?(emilio)

Can you attach your about:support info? I can't repro this.

Flags: needinfo?(emilio) → needinfo?(cpeterson)

Also is this mica specific? I'd be a bit surprised because regular context menus have been using a similar code-path since ~forever...

Summary: Mica content menu is empty the second time it's opened on a page → Mica context menu is empty the second time it's opened on a page
Blocks: windows-mica

Chris, ping, can you still repro this? If so I need more info to make it actionable :)

I saw it once when the browser(maybe even the parent process) was very busy with something.
I right clicked, and the context menu was empty.

Emilio, sorry for the late reply! I was out on PTO all last week.

I've identified a missing step to reproduce this bug: in addition to enabling the mica prefs, you need to enable Software WebRender (gfx.webrender.software pref = true and then restart Firefox).

Flags: needinfo?(cpeterson) → needinfo?(emilio)
Keywords: regression
Regressed by: 1948565
Summary: Mica context menu is empty the second time it's opened on a page → Mica context menu is empty the second time it's opened on a page (when SW-WR is enabled)

I see now that simply enabling gfx.webrender.software (SW-WR) without the mica prefs causes the context menu to not open at all after the second right click. I bisected that bug to this pushlog for your fix for transparent window popups bug 1948565:

https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=749544d5d463ad3bc864266996d264131ebc026e&tochange=3eb7c1efd1e0a5cc4a4af80975479bdb174fac72

I've reworded this bug to be about the bug 1948565 regression without Mica since that regression doesn't require any non-default prefs (like Mica) since some users will be using SW-WR because of their hardware configuration.

So:

  1. Transparent window popups bug 1948565 caused the context menu to only open once when using SW-WR
  2. And then Mica bug 1924741 allowed the context menu popup to be shown more than once, but the menu was empty.
No longer blocks: 1924741
See Also: → 1924741
Summary: Mica context menu is empty the second time it's opened on a page (when SW-WR is enabled) → Context menu is only opened the first right click when using SW-WR

Thanks, I can repro that. Can you confirm that if you do that and hover over where the popup would be, it appears? That is what I see here.

Flags: needinfo?(emilio) → needinfo?(cpeterson)
Flags: needinfo?(emilio)

Can you confirm that if you do that and hover over where the popup would be, it appears? That is what I see here.

Yes, I see that behavior, too.

This bug also affects opening (some?) bookmarks folders on the bookmarks toolbar.

Flags: needinfo?(cpeterson)
Summary: Context menu is only opened the first right click when using SW-WR → Context menus only open the first mouse click when using SW-WR

It is the right thing to do, and fixes this. Otherwise we need to
somehow invalidate SWGL after showing a window...

It's been 3 years since we last tried to do it and it is early in the
cycle. If intermittents show up we can fix them. We can fix this
regression in 137 by backout.

For reference, another thing that worked, was forcing a full render
in RendererOGL.cpp, but that's obviously not ok, generally.

Assignee: nobody → emilio
Status: NEW → ASSIGNED
Flags: needinfo?(emilio)
No longer blocks: windows-mica
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9d75dd384f42 Clear all cached WR resources when hiding a popup. r=gfx-reviewers,gw

Backed out for causing crashes @ browser_multiselect_tabs_play.js

Backout link: https://hg.mozilla.org/integration/autoland/rev/19d3e66835cbcf5dc6a6b46c3be63162e7657df0

Push with failures

Failure log

Flags: needinfo?(emilio)
Flags: needinfo?(emilio)
Flags: needinfo?(emilio)

Ok, so I got this in pernosco and I see what's going on.

Basically, we build WR commands for a popup, and immediately after we close the popup, clearing the pipeline for the async canvas. I think subdocuments ignore missing pipelines and I think it's fine to do so here as well.

Flags: needinfo?(emilio)
Attachment #9470123 - Attachment is obsolete: true

Much like subdocuments do. See last comment in the bug for a pernosco
link which shows what's going on.

This only changes behavior in debug builds.

Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9ffee066755c Allow to ignore missing canvas pipeline. r=gfx-reviewers,aosmond
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/67edfa448024 Clear all cached WR resources when hiding a popup. r=gfx-reviewers,gw
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 138 Branch

The patch landed in nightly and beta is affected.
:emilio, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox137 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(emilio)

Comment on attachment 9469841 [details]
Bug 1949914 - Clear all cached WR resources when hiding a popup. r=#gfx-reviewers

Beta/Release Uplift Approval Request

  • User impact if declined/Reason for urgency: comment 5
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: comment 5
  • List of other uplifts needed: none
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Relatively tiny change (two oneliners).
  • String changes made/needed: none
  • Is Android affected?: No
Flags: needinfo?(emilio)
Flags: qe-verify+

Comment on attachment 9469841 [details]
Bug 1949914 - Clear all cached WR resources when hiding a popup. r=#gfx-reviewers

(Not sure why the flag didn't get updated)

Attachment #9469841 - Flags: approval-mozilla-beta?
Attachment #9470218 - Flags: approval-mozilla-beta?
Attachment #9469841 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9470218 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
QA Whiteboard: [qa-triaged]

Reproduced the issue with Firefox 137.0a1 (2025-02-21) on Windows 10x64 with gfx.webrender.software: true (steps from comment 5). The context menu is no longer opened a second time.
The issue is verified fixed with 137.0b4 and 138.0a1 (2025-03-10) on Windows 10x64, macOS 12 and Ubuntu 24. The context menu is correct opened a second time with gfx.webrender.software: true. On Windows 10x64 I have also verified that the context menu is correctly opened a second time while having widget.windows.mica.popups: true and gfx.webrender.software: true.

Status: RESOLVED → VERIFIED
Has STR: --- → yes
QA Whiteboard: [qa-triaged]
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: