Chrome PWA opens a new instance from App Launcher instead of focusing existing window — KDE Plasma 6.6 / Wayland / Fedora 44

Chrome PWA opens a new instance from App Launcher instead of focusing existing window — KDE Plasma 6.6 / Wayland / Fedora 44


System Information

OS Fedora 44
KDE Plasma 6.6
KDE Frameworks (latest via Fedora 44 repos)
Qt Version (latest via Fedora 44 repos)
Graphics Platform Wayland
Browser Google Chrome (stable)
Hardware ASUS Vivobook, AMD Ryzen AI 9 HX 370, AMD Radeon Graphics

Description

When a Chrome PWA (e.g. WhatsApp Web) is already running, clicking it again from the App Launcher (Kickoff) opens a second instance instead of raising/focusing the existing window.

I have verified this is KDE Plasma + Wayland specific by testing on the same Fedora 44 installation with other desktops:

  • :white_check_mark: GNOME — focuses existing window correctly
  • :white_check_mark: COSMIC desktop — focuses existing window correctly
  • :cross_mark: KDE Plasma 6.6 on Wayland — always opens a new instance

Steps to Reproduce

  1. Install a Chrome PWA (e.g. WhatsApp Web via Chrome → More Tools → Create Shortcut → Open as window)
  2. Open the PWA — it is now running
  3. Open App Launcher (Kickoff) and search for the PWA by name
  4. Click it

Expected: Existing window is raised and focused
Observed: A second instance of the PWA opens


Debugging Done

I used qdbus org.kde.KWin /KWin org.kde.KWin.queryWindowInfo while clicking the WhatsApp window and got:

caption:      WhatsApp Web
desktopFile:  chrome-hnpfjngllnobngcgfapefoaidbinmjnm-Profile_1
resourceClass: chrome-hnpfjngllnobngcgfapefoaidbinmjnm-Profile_1
resourceName: chrome

The PWA is running as a native Wayland window (confirmed because wmctrl -x -l does not list it at all, only XWayland windows appear).

kdotool search --class chrome-hnpfjngllnobngcgfapefoaidbinmjnm-Profile_1 does correctly detect the window and returns its UUID.


What I Have Already Tried

  1. StartupWMClass in .desktop file — tried both:

    • crx_hnpfjngllnobngcgfapefoaidbinmjnm (XWayland/X11 format)
    • chrome-hnpfjngllnobngcgfapefoaidbinmjnm-Profile_1 (matches resourceClass from qdbus)
  2. Renamed .desktop file to exactly match the desktopFile value KDE reports:
    ~/.local/share/applications/chrome-hnpfjngllnobngcgfapefoaidbinmjnm-Profile_1.desktop

  3. Set chrome://flags/#ozone-platform-hint to Auto — Chrome now runs natively on Wayland (confirmed via chrome://gpu), but the problem persists

  4. Refreshed KDE databases after every change:

    update-desktop-database ~/.local/share/applications/
    kbuildsycoca6 --noincremental
    
  5. wmctrl wrapper script — does not work because the PWA is a native Wayland window invisible to wmctrl

  6. kdotool wrapper script — built kdotool from source (not available in Fedora 44 repos). Script detects the window correctly from terminal, but the App Launcher still spawns a new instance rather than running the wrapper


Current .desktop file contents

[Desktop Entry]
Version=1.0
Terminal=false
Type=Application
Name=WhatsApp Web
Exec=/opt/google/chrome/google-chrome "--profile-directory=Profile 1" --app-id=hnpfjngllnobngcgfapefoaidbinmjnm
Icon=chrome-hnpfjngllnobngcgfapefoaidbinmjnm-Profile_1
StartupWMClass=chrome-hnpfjngllnobngcgfapefoaidbinmjnm-Profile_1
StartupNotify=false

Questions

  1. Is there a correct way to make KWin/Plasma associate an already-running native Wayland Chrome PWA window with its .desktop launcher entry?
  2. Is this related to the XDG Activation token not being passed correctly by Chrome when it requests focus? (I noticed Bug #443725 mentions this pattern)
  3. Is there a KWin scripting API or DBus call that can be used to reliably focus an existing window by its desktopFile or UUID before the launcher spawns a new process?
  4. Are there any known fixes or workarounds planned for Plasma 6.x?

Thank you for any guidance.

1 Like