Firefox window invisible on Wayland (GNOME) on first launch when no startup activation token is present
Categories
(Core :: Widget: Gtk, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox152 | --- | fixed |
People
(Reporter: anna.weine, Assigned: stransky)
Details
Attachments
(1 file, 1 external file)
|
2.75 KB,
text/plain
|
Details |
On Wayland/GNOME (reproduced on Ubuntu 25.04 stock), the Firefox window opens invisible
on first launch after a normal session exit. The process is running and responsive, but
the window does not appear on the current workspace. Restarting Firefox does not help;
the window reappears only if sizemode in xulstore.json is manually changed to maximized.
Root cause:
RequestWaylandFocusPromise() in widget/gtk/WidgetUtilsGtk.cpp requires a focused Firefox
source window to construct an xdg_activation_v1 token (to attach a seat serial and
surface). On first launch there is no such window, so the function returns nullptr.
TransferFocusTo() silently fails, no xdg_activation_v1_activate() call is made, and
Mutter places the new window using its own heuristics.
When a phantom or previously-connected external monitor is still present in the
compositor's output configuration (even if physically disconnected), Mutter's heuristic
can place the window on that output rather than the currently active workspace, making it
invisible to the user.
Steps to reproduce:
- Connect an external monitor to a laptop running Ubuntu 25.04 with GNOME Wayland.
- Use Firefox normally, then close it.
- Disconnect the external monitor (the phantom output remains in compositor config).
- Launch Firefox — the window is invisible (process runs, ps confirms it, no window on
screen).
Also reproducible without an external monitor in some GNOME configurations where dynamic
workspaces place the window on a non-active workspace.
Expected: Firefox window appears on the current active workspace.
Actual: Firefox window is invisible; process is running.
Fix:
The xdg-activation-v1 protocol permits committing a token without set_serial/set_surface
(a "bare token"). Such a token carries no focus-stealing rights but is accepted by Mutter
as a workspace placement hint. Restructure RequestWaylandFocusPromise() to always commit
a token, attaching serial/surface only when a focused source window is available. This
ensures first-launch windows are placed on the current workspace.
| Reporter | ||
Comment 1•7 months ago
|
||
| Reporter | ||
Comment 2•7 months ago
|
||
The text was generated by AI. It was happening every month on my laptop, and unfortunately I do not have enough knowledge to assess how wrong/right the code..
| Reporter | ||
Comment 3•7 months ago
|
||
The bug ClaudeGPT found the previous time is described here: https://mozilla.slack.com/archives/C027LFU26/p1774559029222309
| Assignee | ||
Updated•7 months ago
|
| Assignee | ||
Comment 4•7 months ago
|
||
Not sure it works but the approach is reasonable and matches the protocol. Serial/surface params are optional.
| Assignee | ||
Updated•7 months ago
|
| Assignee | ||
Comment 5•7 months ago
|
||
Original patch by Anna Weine.
Updated•7 months ago
|
Comment 7•7 months ago
|
||
| bugherder | ||
Description
•