Skip to content

gpui_linux: Consume Wayland startup activation token - #59995

Merged
Anthony-Eid merged 2 commits into
mainfrom
gpui-linux-consume-wayland-startup-token
Jun 29, 2026
Merged

gpui_linux: Consume Wayland startup activation token#59995
Anthony-Eid merged 2 commits into
mainfrom
gpui-linux-consume-wayland-startup-token

Conversation

@Anthony-Eid

@Anthony-Eid Anthony-Eid commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

When opening Zed from GNOME on Wayland, the cursor can stay stuck in the launch spinner state for several seconds because GPUI never tells the compositor that the launched app's first window has loaded. Desktop launchers pass this information through XDG_ACTIVATION_TOKEN, which Wayland clients are expected to consume once their first toplevel surface is ready.

This PR fixes that by reading and removing XDG_ACTIVATION_TOKEN during Wayland client startup, storing it on the client state, and consuming it on the first XDG toplevel surface via the existing xdg_activation_v1.activate(token, surface) plumbing. Anthony manually verified this on GNOME Wayland.

docs ref: https://wayland.app/protocols/xdg-activation-v1

Release Notes:

  • Fixed Linux Wayland cursor being stuck as a spinner for a couple of seconds.

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Jun 27, 2026
@zed-community-bot zed-community-bot Bot added the staff Pull requests authored by a current member of Zed staff label Jun 27, 2026
@cole-miller
cole-miller self-requested a review June 27, 2026 14:38
Comment thread crates/gpui_linux/src/linux/wayland/client.rs
@Anthony-Eid
Anthony-Eid added this pull request to the merge queue Jun 29, 2026
Merged via the queue into main with commit 7c3160b Jun 29, 2026
34 checks passed
@Anthony-Eid
Anthony-Eid deleted the gpui-linux-consume-wayland-startup-token branch June 29, 2026 15:19
AprilNEA pushed a commit to AprilNEA/OpenLogi that referenced this pull request Jul 18, 2026
…vation rework (#400)

On Linux the GUI could panic at startup ("RefCell already borrowed" in
gpui_linux's with_common, wayland client.rs:924 / x11 client.rs:1529),
preceded by an "activation token received with no pending activation"
error from the xdg-activation Done handler. The pinned zed rev predated
gpui's rework of Wayland startup activation (zed-industries/zed#59995),
which consumes the launcher's XDG_ACTIVATION_TOKEN on the first toplevel
instead of leaving the startup round-trip to racy self-activation.

Move the zed pin from eb2223c0 (2026-05-24) to 1a246efd (2026-07-15) —
the rev gpui-component master builds against — and bump gpui-component/
gpui-component-assets to 031555662e99 in lockstep, since the old pair
does not compile against any newer gpui. The only API drift on our side
is gpui's BoxShadow gaining an inset field.

The spurious "no pending activation" startup error is gone with the new
pin, and Wayland + X11 startup, OS light/dark flips, and window reopen
were exercised without a panic.
jolutz pushed a commit to jolutz/zed that referenced this pull request Aug 8, 2026
…59995)

When opening Zed from GNOME on Wayland, the cursor can stay stuck in the
launch spinner state for several seconds because GPUI never tells the
compositor that the launched app's first window has loaded. Desktop
launchers pass this information through `XDG_ACTIVATION_TOKEN`, which
Wayland clients are expected to consume once their first toplevel
surface is ready.

This PR fixes that by reading and removing `XDG_ACTIVATION_TOKEN` during
Wayland client startup, storing it on the client state, and consuming it
on the first XDG toplevel surface via the existing
`xdg_activation_v1.activate(token, surface)` plumbing. Anthony manually
verified this on GNOME Wayland.


docs ref: https://wayland.app/protocols/xdg-activation-v1

Release Notes:

- Fixed Linux Wayland cursor being stuck as a spinner for a couple of
seconds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants