Ubuntu + Claude Desktop: fixing the workspace focus jump

Symptom: On Ubuntu (GNOME, Wayland) with the Claude desktop app running, clicking an app in the dock that lives on another workspace switches there for a split second and then jumps straight back to the Claude window. Switching workspaces with Super+scroll works fine, clicking apps on the same workspace works fine, and with Claude quit everything is normal.

What it is not: the dock. My Dash-to-Dock settings were default (isolate-workspaces false, click-action focus-or-appspread). It is also not XWayland focus stealing, because xlsclients showed Claude was running as a native Wayland client. Somewhere in the app, the window seems to grab focus again right after the workspace change.

Fix: run Claude through XWayland instead of native Wayland by passing the Ozone flag --ozone-platform=x11.

Test it first. Quit Claude completely, including the tray process, otherwise the new start just hands off to the old instance and the flag is silently ignored:

pkill -9 -f /usr/lib/claude-desktop; sleep 2; pgrep -af -i claude
setsid claude-desktop --ozone-platform=x11 </dev/null >/dev/null 2>&1 &
sleep 5; xlsclients

If claude-desktop now appears in the xlsclients list, it is running under X11. Click an app on another workspace in the dock. In my case the jump-back was gone.

To make it permanent, edit a per-user copy of the launcher (com.anthropic.Claude.desktop in ~/.local/share/applications/), which takes precedence over the system one:

cp ~/.local/share/applications/com.anthropic.Claude.desktop ~/.local/share/applications/com.anthropic.Claude.desktop.bak
sed -i 's|^Exec=claude-desktop |Exec=claude-desktop --ozone-platform=x11 |' ~/.local/share/applications/com.anthropic.Claude.desktop
update-desktop-database ~/.local/share/applications

If there is no local copy yet, copy /usr/share/applications/com.anthropic.Claude.desktop there first.

Trade-offs: XWayland can make text slightly blurry with fractional scaling, and global shortcuts may behave differently. A package update may reset the launcher file, in which case just rerun the sed line.

Debugging tip: if you start the app from a terminal with & and the shell reports Stopped, the process was suspended waiting for terminal input. Use setsid ... </dev/null >/dev/null 2>&1 & as above.