Closed Bug 1958695 Opened 1 year ago Closed 1 year ago

[wayland] Privacy Badger Addon Icon menu on the left side of toolbar sometimes not visible

Categories

(WebExtensions :: Frontend, defect)

Firefox 137
defect

Tracking

(firefox140 fixed)

RESOLVED FIXED
140 Branch
Tracking Status
firefox140 --- fixed

People

(Reporter: o2q2tcedsh0, Assigned: emilio, NeedInfo)

References

(Blocks 2 open bugs)

Details

Attachments

(10 files, 3 obsolete files)

Attached image fail.png

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

Steps to reproduce:

Debian Stable with Firefox .deb from Mozilla Repository or Flatpak.
Install the addon Privacy Badger.

Go to customize toolbar. Now drag the Privacy Badger icon to the left side of the menu bar.

Go to the website: https://www.golem.de/ticker/ or ing.de

Actual results:

Now press the Privacy Badger icon and you can see that it is empty.

With Firefox 136.0.4 i could not repoduce this error.

Attached image ok.png

Could you try running mozregression to help to identify the issue, since you mention it works in 136.0.4?
https://mozilla.github.io/mozregression/quickstart.html

I can't reproduce the issue on Nightly and macOS.

Flags: needinfo?(o2q2tcedsh0)

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

Component: Untriaged → Toolbars and Customization

Hello.
Link to the communication on camp-firefox.de
https://www.camp-firefox.de/forum/thema/139189-privacy-badger-2025-3-27-probleme-mit-der-darstellung-der-trackeranzeige/

I was able to reproduce the issue on Ubuntu 24 LTS and on Debian 12, both with Firefox 137. But not on Debian 12 with Firefox DEB 139 Nightly (Mozilla source). and not on windows or Mint for any firefox.
what i also can reproduce that constant clicking on the button that content is flickering for some milliseconds, then gone. i am not fully familiar with the Inspector and browser tools so i was not able to determine if it is firefox, or page content (moz-extension...)
and it happens also for Privacy Badger 2025.3.3, the previous build.
so i assume also a bug in firefox, but only for some builds.

have a nice day.

Sorry, I don't understand this output. You should have a single link to a pushlog at the end of the process.

can you deal with the pushlog links in text or not? you are the expert, i am only user trying to help out.
the order ist good/bad/bad/bad/good. i dont know the order or the time or which one is important. and i prefer to give full/much information as i can.
if you feel upset, then sorry.

From https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=8b410273f3e55ab7341ea6375e3d5defbfcb6cae&tochange=9efb94e533503b0cd1309c16d01d488a69941059, only bug 581863 makes sense to me as a potential regressor. :emilio, is it possible that your change caused such a regression?

Flags: needinfo?(emilio)

I can't reproduce this bug on Firefox 137 on Pop OS 22.04 LTS.

(In reply to Sören Hentzschel from comment #8)

From https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=8b410273f3e55ab7341ea6375e3d5defbfcb6cae&tochange=9efb94e533503b0cd1309c16d01d488a69941059, only bug 581863 makes sense to me as a potential regressor. :emilio, is it possible that your change caused such a regression?

It is not impossible, in the sense that it is a linux window positioning change, and this is in a popup which is a native window. However, it seems somewhat unlikely since that should've only affected top level windows...

That said, that pushlog doesn't have any other more likely candidate really, so let's roll with it.

I was able to reproduce the issue on Ubuntu 24 LTS and on Debian 12, both with Firefox 137. But not on Debian 12 with Firefox DEB 139 Nightly (Mozilla source). and not on windows or Mint for any firefox.

What DE / compositor? GNOME? If so, Wayland or X11? Could you go to about:support and attach the information here?

Given this doesn't reproduce on 139, would it be possible for someone that can reliably reproduce to run mozregression --bad 137 --find-fix? That'd be able to see what makes it work on 139.

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

In my case it's on Gnome Wayland and i cant reproduce it on Firefox Nightly.

Flags: needinfo?(o2q2tcedsh0)
Attached file raw.txt (obsolete) —
Attached file text.txt (obsolete) —
Attached file raw-en.txt
Attached file text-en.txt
Attachment #9477359 - Attachment is obsolete: true
Attachment #9477360 - Attachment is obsolete: true
Component: Toolbars and Customization → Frontend
Product: Firefox → WebExtensions

I could not reproduce the issue either, using the latest Privacy Badger v. 2025.3.27, on the latest Nightly (139.0a1/20250407212917), Beta (138.0b4/20250407102644) or Release (137.0/20250327043313) under Windows 11 and Ubuntu 24.04 LTS.

Nor did I reproduce the issue on the latest Release (137.0/20250331133932, Distribution ID canonical-002, from the Ubuntu Store) on Ubuntu 24.04 LTS.

Attached image ing.de-ubuntu-24.10.png
Attached image golem-ubuntu-24.10.png

I can reproduce it on the following systems.

Ubuntu 24.10 Snap Firefox 137.0.1 RC
Ubuntu 24.10 Snap Firefox 137 Stable

Debian Stable
Firefox 137 from Mozilla .deb package (packages.mozilla.org...)
Firefox 137 Flatpak

Attached image Disconnect.png

While I was unable to reproduce this on Firefox 137.0 Pop OS 22.04 LTS X11, Disconnect addon only shows a line as seen in the screenshot attached. I just wanted to share this in case it is related to this bug.

Emilio, does the provided information allow you to debug the issue?

Flags: needinfo?(emilio)

No, disconnect thing in comment 20 seems totally unrelated, and I haven't managed to reproduce this in either gnome or KDE...

Flags: needinfo?(emilio)
Duplicate of this bug: 1964278

Emilio, we got another report, is there anything we could ask reporters to try to diagnose this?

Flags: needinfo?(emilio)

Hiro, I think you've worked on similar stuff. Any idea?

A log with MOZ_LOG=WidgetPopup:5 of this happening could be useful to see if there's something off.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(emilio) → needinfo?(hikezoe.birchill)

By code inspection, but I could see this code getting confused with
popup moves like the ones in wayland...

I think I found something by code inspection...

Let me try to dig a bit more but without reproducing it's quite hard. I'll have a link to builds in a bit, if affected people could try them it'd be good.

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

Ok I think I can reproduce consistently if I trigger a resize of the <browser> in the popup. Let me debug that when I have some time.

Flags: needinfo?(emilio)

So on a debug build this repros a lot easier. STR:

  • Install Privacy Badger (probably other popups work too).
  • Put it at the left of the urlbar, in a way such that the popup would be partially out of the window (this causes us to use the move-to-rect codepath on Wayland).
  • Click on the toolbar icon, or make it blank. If that shows a popup, do something like this on the browser console:
document.querySelector("panel browser").style.width = "450px"; // Or anything different from the default width

That triggers another hide/move-to-rect/show cycle and makes it very likely to hit. It is really really likely with D247773 applied.

When it hits, the content process is waiting for paints in here so it doesn't paint itself. But that probably means that the compositor is still paused somehow?

A few other observations:

  • We hit an early out on OnExposeEvent() here.
  • I still think D247773 is an improvement and we should probably try to get it landed, but it doesn't fix this bug.

Martin, Sotaro, this is more your area of expertise than mine, any chance you could take a look?

Flags: needinfo?(stransky)
Flags: needinfo?(sotaro.ikeda.g)
Flags: needinfo?(emilio)

Emilio,
can you try with widget.wayland.vsync.enabled set to false?
I think the hide/show sequence postpones the vsync frame callbacks somehow and we use HW vsync / HW acceleration for remote popups.
Thanks.

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

I can repro just fine with it set to false. To be clear vsync ticks arrive just fine to the content process, we just bail out because we're still waiting for other paints.

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

I'll try to record this with rr.

Summary: Privacy Badger Addon Icon menu on the left side of toolbar sometimes not visible → [wayland] Privacy Badger Addon Icon menu on the left side of toolbar sometimes not visible

pernosco session here.

So the layer manager is recreated on unmap during the temporary-hidden state. That seems both wasteful and unfortunate?

A patch like this fixes the issue locally:

diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp
index 5db3494b8eab..aeab577efb2a 100644
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -9857,7 +9857,7 @@ void nsWindow::OnUnmap() {

   // Until Bug 1654938 is fixed we delete layer manager for hidden popups,
   // otherwise it can easily hold 1GB+ memory for long time.
-  if (mWindowType == WindowType::Popup) {
+  if (mWindowType == WindowType::Popup && !mPopupTemporaryHidden) {
     DestroyLayerManager();
   } else {
     // Widget is backed by OpenGL EGLSurface created over wl_surface/XWindow.

But that probably means that there is still a bug somewhere else.

Ok, so I dug a bit more and I think that's the right fix (at least for now). I took some notes in the pernosco session, but basically:

  • Destroying the popup's layer manager ends up also destroying all the child WebRender bridges.
  • The WRBridge for the remote content is destroyed with some pending transactions that aren't sent back to the content process.
  • But even if they were, the content process will end up being disconnected after all / nothing re-creates the PuppetWidget's renderer.

So I think the code is just not set up to survive a LayerManager destruction while keeping rendering of remote contents working.

Destroying the popup's layer manager ends up also destroying all the
child WebRender bridges.

The WRBridge for the remote content is destroyed with some pending
transactions that aren't sent back to the content process.

Even if they were, the content process will end up being disconnected
after all / nothing re-creates the PuppetWidget's renderer.

So I think the code is just not set up to survive a LayerManager
destruction while keeping rendering of remote contents working.

There's no good reason to clear these, too, they're likely to be shown
right after.

Assignee: nobody → emilio
Status: NEW → ASSIGNED
Attachment #9485359 - Attachment description: WIP: Bug 1958695 - Deal with popups in Document::UpdateRemoteFrameEffects rather than out of band. → Bug 1958695 - Deal with popups in Document::UpdateRemoteFrameEffects rather than out of band. r=stransky,#layout,smaug
Flags: needinfo?(stransky)
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/18b9500a0b40 Don't destroy layer manager of temporarily hidden Wayland popup. r=stransky

When I realized this need-info, It looks like the bug has already been resolve. :)

Flags: needinfo?(hikezoe.birchill)
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 140 Branch
Flags: needinfo?(sotaro.ikeda.g)
Blocks: 1965188

Comment on attachment 9485359 [details]
Bug 1958695 - Deal with popups in Document::UpdateRemoteFrameEffects rather than out of band. r=stransky,#layout,smaug

Revision D247773 was moved to bug 1965188. Setting attachment 9485359 [details] to obsolete.

Attachment #9485359 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: