Closed Bug 2092658 Opened 9 days ago Closed 1 day ago

Firefox on native Wayland fails to request taskbar attention for JavaScript alert() dialogs

Categories

(Core :: Widget: Gtk, defect)

Firefox 160
defect

Tracking

()

RESOLVED FIXED
163 Branch
Tracking Status
firefox163 --- fixed

People

(Reporter: bugzilla, Assigned: sinker)

References

(Blocks 1 open bug)

Details

Attachments

(1 external file)

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

Steps to reproduce

Title: Firefox on native Wayland fails to request taskbar attention for JavaScript alert() dialogs

Environment: Arch Linux, KDE Plasma (Wayland), Firefox

Steps to reproduce:

  1. Run Firefox using its native Wayland backend.
  2. Open the developer console and execute:
    setTimeout(() => alert("Attention test"), 5000);
  3. Switch to another application before the alert appears.
  4. Observe Firefox's taskbar entry.

Expected result:
Firefox requests attention, causing its KDE Plasma taskbar entry to flash orange.

Actual result:
No attention indicator appears. KWin Debug Console reports demandsAttention = false.

Additional testing:

  • Running Firefox under XWayland (MOZ_ENABLE_WAYLAND=0 firefox) restores the expected behavior.
  • A native Wayland PyQt6 application using QApplication.alert() correctly triggers KDE's attention indicator.
  • This suggests Firefox's native Wayland implementation is failing to request attention, rather than a general KDE/KWin issue.

Impact:
Background JavaScript alerts, including those generated by userscripts, can go unnoticed.

Actual results

^

Expected results

^

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

Component: Untriaged → Widget: Gtk
Product: Firefox → Core

Yes, that's it. Wayland doesn't allow applications itself to raise over other apps, focus can be only transferred from other already active application window. So the alert should be visible / active when an Firefox window is recently visible / focused. Is it that case?

Blocks: wayland
Flags: needinfo?(bugzilla)

The Firefox window was focused immediately before switching to another application, approximately 5 seconds before the alert appeared.

I understand that Wayland restricts applications from raising themselves or stealing focus, but I'm specifically referring to requesting attention (the orange taskbar indicator, in my case), not raising or focusing the window.

Importantly, a native Wayland PyQt6 application using QApplication.alert() successfully triggers KDE's taskbar attention indicator, even when another application is focused.

Firefox's alert() and prompt() do not trigger this indicator under native Wayland, whereas alert() works under XWayland.

Is Firefox expected to request attention for these dialogs under native Wayland, without attempting to activate the window?

Flags: needinfo?(bugzilla)
Severity: -- → S4

I think it is not about input focus or visibility. It is to give user a hint that Firefox need focus. It can be achieved through xdg-activation.

[1] https://searchfox.org/firefox-main/source/widget/gtk/nsWindow.cpp#5163

GTK3's gdk_window_set_urgency_hint() is a no-op on Wayland, so
nsWindow::GetAttention() did nothing there. Activate the window with an
xdg-activation token that carries no input serial or source surface; the
compositor won't raise the window with it and marks it as demanding
attention instead (KWin, Mutter).

Assignee: nobody → thinker.li
Attachment #9684461 - Attachment description: WIP: Bug 2092658 - Request window attention on Wayland via xdg-activation. r?#gtk-reviewers → Bug 2092658 - Request window attention on Wayland via xdg-activation. r?#gtk-reviewers
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Status: ASSIGNED → RESOLVED
Closed: 1 day ago
Resolution: --- → FIXED
Target Milestone: --- → 163 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: