Closed Bug 1978615 Opened 1 year ago Closed 1 year ago

[wayland] Context menus sometimes briefly show/flash underlying window when first drawn

Categories

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

Firefox 142
defect

Tracking

()

RESOLVED FIXED
144 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 --- unaffected
firefox-esr140 --- unaffected
firefox141 --- unaffected
firefox142 --- wontfix
firefox143 --- wontfix
firefox144 --- fixed

People

(Reporter: ke5trel, Assigned: stransky)

References

(Depends on 1 open bug, Blocks 2 open bugs, Regression)

Details

(Keywords: regression)

Attachments

(1 file, 4 external files, 1 obsolete file)

STR:

  1. Start latest Nightly 143.0a1 with MOZ_ENABLE_WAYLAND=1 on Ubuntu 25.04.
  2. Enable the Dark theme.
  3. Unmaximize the window.
  4. Visit a website with a light background.
  5. Create a new unmaximized window (overlapping existing window).
  6. Show the context menu by right-clicking the bookmarks toolbar.
  7. Show the context menu by right-clicking the tab bar.
  8. Repeat steps 6-7 in different areas.

Expected:
Context menu never shows anything beneath window.

Actual:
Context menu sometimes briefly shows underlying window when created (flashes light color), especially when menu dimensions change.

Only happens when both windows are unmaximized.
Does not happen with MOZ_ENABLE_WAYLAND=0.

Regression window:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=908e181f8330ec6743d1c626b38023270a98be38&tochange=ad16af6bf6aa841019c39de701518f0b5777f9b3

Regressed by Bug 1967114.

:emilio, since you are the author of the regressor, bug 1967114, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

Flags: needinfo?(emilio)

Seems like a mutter bug? Not sure how you'd get that rendering otherwise. Does it happen on other DEs like KDE?

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

Kestrel, please attach your about:support page.
Thanks.

Priority: -- → P3
  • Happens with GNOME 46.0 and 48.0 but not KDE (Kubuntu 25.04).
  • Happens with snap (Mesa 24.2.8.0), tarball (Mesa 25.0.7.0) and flatpak (Mesa 25.1.3.0).
  • Also occurs with Ubuntu 24.04.2 LTS (Mesa 24.2.8.0) on different hardware.
  • Happens with HW-WR and SW-WR.
  • 100% scaling on single display.
  • Clean profile with stock settings.

Is there anything specific in about:support you are interested in?

Flags: needinfo?(ke5trel)

No, that's fine, thanks.

Flags: needinfo?(stransky)

:stransky is this going to be targeting 142?

(In reply to Dianna Smith [:diannaS] from comment #6)

:stransky is this going to be targeting 142?

No, I have no idea what's going on here.

Flags: needinfo?(stransky)
Flags: needinfo?(stransky)

If Bug 1967114 is the regression here it may be caused by improved opaque region handling. We may set opaque region to popup before we actually paint its content so we (correctly) may see any background under the popup before we paint it.

I guess debug build may show it.

I can reproduce that on debug build. The underlying Firefox window has to contain any image to make the effect visible.

Also it's reproducible on 50% cases and perhaps depends on popup content - it's more likely when new popup is opened, repeated popup open doesn't shown it.

Attached file WIP: Bug 1978615 uniqueptr (obsolete) —
Assignee: nobody → stransky
Attachment #9508348 - Attachment description: WIP: Bug 1978615 log opaque region → Bug 1978615 [Wayland] Add logging to nsWindow::UpdateOpaqueRegionInternal() r?emilio
Status: NEW → ASSIGNED
Attachment #9508349 - Attachment description: WIP: Bug 1978615 remove moz_container_wayland_update_opaque_region → Bug 1978615 [Wyland] Remove moz_container_wayland_update_opaque_region() and use WaylandSurface directly r?emilio

The opaque region change takes action even before we have window content painted, so deffer the change
until there's anything painted in the window and we get frame callback for it.

Attachment #9508350 - Attachment is obsolete: true
Attachment #9508349 - Attachment description: Bug 1978615 [Wyland] Remove moz_container_wayland_update_opaque_region() and use WaylandSurface directly r?emilio → Bug 1978615 [Wayland] Remove moz_container_wayland_update_opaque_region() and use WaylandSurface directly r?emilio
Attachment #9508667 - Attachment description: Bug 1978615 [Wyland] Use frame callback to set opaque region of WaylandSurface r?emilio → Bug 1978615 [Wayland] Use frame callback to set opaque region of WaylandSurface r?emilio
Attachment #9509293 - Attachment description: Bug 1978615 [Wyland] Reference WaylandSurface at Unmap() until all Wayland events are processed r?emilio → Bug 1978615 [Wayland] Reference WaylandSurface at Unmap() until all Wayland events are processed r?emilio
Flags: needinfo?(stransky)
Pushed by stransky@redhat.com: https://github.com/mozilla-firefox/firefox/commit/a9aceb66f030 https://hg.mozilla.org/integration/autoland/rev/a2d304a2ecb1 [Wayland] Add logging to nsWindow::UpdateOpaqueRegionInternal() r=emilio https://github.com/mozilla-firefox/firefox/commit/d4e44116a706 https://hg.mozilla.org/integration/autoland/rev/c79844a60269 [Wayland] Remove moz_container_wayland_update_opaque_region() and use WaylandSurface directly r=emilio https://github.com/mozilla-firefox/firefox/commit/23176d9d5453 https://hg.mozilla.org/integration/autoland/rev/3f8a3d4da7d6 [Wayland] Use frame callback to set opaque region of WaylandSurface r=emilio https://github.com/mozilla-firefox/firefox/commit/7b3ff905b56f https://hg.mozilla.org/integration/autoland/rev/8275e572ff73 [Wayland] Reference WaylandSurface at Unmap() until all Wayland events are processed r=emilio
Pushed by ctuns@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/ce1bcb3542c1 https://hg.mozilla.org/integration/autoland/rev/ac66a43ca998 Revert "Bug 1978615 [Wayland] Reference WaylandSurface at Unmap() until all Wayland events are processed r=emilio" for causing build bustages in RefPtr.h

Backed out for causing build bustages

Flags: needinfo?(stransky)

Will look at it, Thanks.

Flags: needinfo?(stransky)
Pushed by stransky@redhat.com: https://github.com/mozilla-firefox/firefox/commit/a16a392ada15 https://hg.mozilla.org/integration/autoland/rev/9d149e211266 [Wayland] Add logging to nsWindow::UpdateOpaqueRegionInternal() r=emilio https://github.com/mozilla-firefox/firefox/commit/9623722e5b71 https://hg.mozilla.org/integration/autoland/rev/8945d6de2c24 [Wayland] Remove moz_container_wayland_update_opaque_region() and use WaylandSurface directly r=emilio https://github.com/mozilla-firefox/firefox/commit/dad358667dff https://hg.mozilla.org/integration/autoland/rev/66bd4fee13bb [Wayland] Use frame callback to set opaque region of WaylandSurface r=emilio https://github.com/mozilla-firefox/firefox/commit/393e9566ac87 https://hg.mozilla.org/integration/autoland/rev/a582687dd82d [Wayland] Reference WaylandSurface at Unmap() until all Wayland events are processed r=emilio

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

For more information, please visit BugBot documentation.

Flags: needinfo?(stransky)
Flags: needinfo?(stransky)
Regressions: 1986260
Depends on: 1986262
QA Whiteboard: [qa-triage-done-c145/b144]
Regressions: 1995559
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: