Skip to content

[Bug] MSEdge popups/tooltips broken #2301

Description

@jbaribeault

Environment

OS Pop!_OS 24.04 (Cosmic)
cosmic-comp 0.1177618137724.04~4df9519
Browser Microsoft Edge 147.0.3912.72 (native Wayland, --ozone-platform=wayland)
Session Wayland

Description

Edge creates tooltip surfaces as xdg_toplevel with no set_parent call, no app_id, and no title. cosmic-comp correctly treats these as independent top-level windows, causing them to appear behind the main Edge window rather than on top of it. The tooltip surface also briefly steals keyboard focus from the main window.

This is a client-side bug in Edge/Chromium's Wayland backend — tooltips should be xdg_popup surfaces with a grab and a parent, not parentless toplevels. However, other compositors (KWin, Mutter) silently accommodate this misbehaviour. A compositor-side heuristic to stack anonymous short-lived toplevels above their client's other surfaces would resolve the symptom while the upstream Chromium fix makes its way through.

Related: #886 (Chromium context menus behind dialogs — same root cause)

Steps to reproduce

  1. Launch Microsoft Edge under native Wayland (--ozone-platform=wayland)
  2. Hover over any toolbar button or link to trigger a tooltip
  3. Observe tooltip appears behind the main window briefly, or not at all

Expected behaviour

Tooltip appears above the main Edge window.

Actual behaviour

Tooltip is z-ordered as a peer of the main window (or behind it). It also briefly steals keyboard focus (wl_keyboard.leave fires on the main surface, wl_keyboard.enter fires on the tooltip surface).

WAYLAND_DEBUG trace (tooltip surface lifecycle)

 -> xdg_surface#92.get_toplevel(new id xdg_toplevel#80)
 -> zxdg_decoration_manager_v1#15.get_toplevel_decoration(new id zxdg_toplevel_decoration_v1#65, xdg_toplevel#80)
 -> xdg_toplevel#80.set_app_id("")
 -> xdg_toplevel#80.set_title("")
 -> xdg_toplevel#80.set_min_size(1, 1)
 -> xdg_toplevel#80.set_max_size(0, 0)
 -> zxdg_toplevel_decoration_v1#65.set_mode(1)
    [compositor assigns 88x31]
 -> zxdg_toplevel_decoration_v1#65.destroy()
 -> xdg_toplevel#80.destroy()
    [wl_keyboard.leave on main surface, wl_keyboard.enter on tooltip surface]
    [xdg_toplevel#51 (main window) reconfigured after tooltip destroyed]

set_parent is never called. Empty app_id, empty title, 1×1 minimum size, 88×31 actual size, ~20ms lifetime. No Edge/Chromium launch flags alter this behaviour.

Suggested compositor workaround

Heuristic: if an xdg_toplevel from the same client has empty app_id + empty title + small dimensions + no set_parent, stack it above all other toplevels from that client. This matches the implicit behaviour of KWin and Mutter for broken Chromium clients.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions