Skip to content

fix(overlay): open the Actions Ring at a fractional Wayland scale - #2070

Open
4ni1ak wants to merge 4 commits into
AprilNEA:masterfrom
4ni1ak:fix/overlay-wayland-protocol-exit
Open

4ni1ak wants to merge 4 commits into
AprilNEA:masterfrom
4ni1ak:fix/overlay-wayland-protocol-exit

Conversation

@4ni1ak

@4ni1ak 4ni1ak commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Two fixes for the Actions Ring on a fractional-scale Wayland output (#1989):

  1. The ring opens. A fractional-scale event can reach the overlay's layer surface before the compositor has configured its size. gpui-pre-linux then sends wp_viewport.set_destination(0, 0), a protocol error that ends the whole Wayland connection, so the ring never opens at a fractional scale, on any output. This PR patches gpui-pre-linux so it sets the viewport destination only once both dimensions are positive; the configure that assigns the real size calls back in and sets it then. This is the same width > 0 && height > 0 guard that reporters in [Bug]: Linux Wayland (KDE, Hyprland, wlroots): openlogi-overlay gets a fatal wp_viewport error at startup on non-1.0 scales, then busy-loops (Actions Ring never shows, ~100% CPU, journal flood) #1989 built and confirmed on KWin, Hyprland and wlroots (MangoWC).
  2. The overlay exits instead of spinning if a protocol error still happens. calloop-wayland-source 0.4.1 keeps only I/O errors from the socket read and flush paths and drops WaylandError::Protocol, so after a disconnect the dead socket stays readable and every iteration fails the same way: one report logged about 10 million lines in 11 seconds. Smithay fixed this in c52f3fe, not yet on crates.io. With it, GPUI's event loop returns, the process exits, and the agent's normal backoff takes over.

Both are stopgaps until upstream releases: zed-industries/zed#61368 (open since July) for the guard, and a calloop-wayland-source release after 0.4.1. Each patch has a comment saying when to drop it.

Changes

  • vendor/gpui-pre-linux: a copy of the crates.io 0.3.10 release, the version gpui-pre pins. The first commit adds it verbatim (minus packaging metadata files), so the second commit shows the one change as a small diff: the guard in set_size_and_scale in src/linux/wayland/window.rs.
  • Cargo.toml:
    • [patch.crates-io] points gpui-pre-linux at the vendored copy, and calloop-wayland-source at Smithay's cab67860 (c52f3fe plus the follow-up EINTR handling, still version 0.4.1).
    • [workspace] exclude = ["vendor"], so the vendored crate is a path dependency, not a member, and workspace lints, fmt and clippy do not apply to it.
  • Cargo.lock: only the source lines of those two crates change; no other resolution changes.
  • .cargo/deny.toml: allows https://github.com/Smithay/calloop-wayland-source.
  • .config/typos.toml: excludes vendor/.
  • packaging/linux/package.nix: adds vendor to the source fileset, and the outputHashes entry for the calloop git dependency. I computed that NAR hash locally without Nix; the same method reproduces the existing appicon hash exactly. Nix CI will confirm it.

Testing

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace
  • RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --document-private-items --exclude openlogi-ui --exclude openlogi-desktop --exclude openlogi-overlay --exclude openlogi-agent
  • ast-grep scan
  • cargo test -p gpui-pre-linux --lib viewport_destination: the guard's regression tests. vendor/ is outside the workspace, so the workspace test run skips them. Counter-proof: with the size check removed, an_unconfigured_surface_gets_no_destination fails.

All green with RUSTFLAGS="-D warnings" on Linux x86_64, on the tip rebased onto current master. Not run: cargo-deny (not installed here), typos (not installed here) and the Nix build.

Not runtime-tested here: I have no fractional-scale Wayland setup. The guard itself is the one reporters in #1989 applied to gpui-pre-linux and ran on KWin, Hyprland and wlroots. To test, run KDE Plasma Wayland at 115% or 125% scale and press the Actions Ring button:

  • Before: no ring, openlogi-overlay near 100% CPU, Protocol error 0 on object wp_viewport@… logged endlessly.
  • After: the ring opens, with no wp_viewport error.

Fixes #1989
Fixes #2526
Fixes #2553
Fixes #2585

@greptile-apps

greptile-apps Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · The PR appears safe to merge; no new blocking issue was established.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new blocking issue was established.

Summary

Patches the Linux backend so an early fractional-scale event does not send a zero-size viewport destination.

  • The Actions Ring waits for a real Wayland surface size before setting its viewport.
  • Wayland protocol errors can now stop the overlay instead of leaving it spinning.

No new actionable findings were established. The prior unnumbered coverage thread was reviewed and was not reposted. No builds, tests, Nix builds, or fractional-scale Wayland checks were run during this review.

Diagram

sequenceDiagram
  participant C as Wayland compositor
  participant W as Wayland window
  participant V as Viewport
  C->>W: Fractional scale before size
  W->>W: Skip destination while size is zero
  C->>W: Configure positive size
  W->>W: resize → set_size_and_scale
  W->>V: Set positive destination
Loading

Reviews (7) · Last reviewed commit: "test(overlay): cover the zero-size viewp..." · Reviewed by Greptile

@davidbudnick davidbudnick added area: gui Graphical user interface platform: linux Linux-specific issue type: bug Something is broken or behaves incorrectly labels Oct 27, 2026
@4ni1ak
4ni1ak force-pushed the fix/overlay-wayland-protocol-exit branch from db161e2 to 8b293b5 Compare November 4, 2026 12:28
@AprilNEA AprilNEA added the needs: decision Needs a maintainer/product decision label Nov 4, 2026 — with Manus Connector
@4ni1ak
4ni1ak force-pushed the fix/overlay-wayland-protocol-exit branch from 8b293b5 to 9fa9407 Compare November 6, 2026 19:30
@4ni1ak
4ni1ak requested a review from davidbudnick as a code owner November 6, 2026 19:30
@4ni1ak 4ni1ak changed the title fix(overlay): exit on a Wayland protocol error instead of spinning fix(overlay): open the Actions Ring at a fractional Wayland scale Nov 6, 2026
calloop-wayland-source 0.4.1 keeps only I/O errors from the socket read
and flush paths and drops protocol errors. After the compositor
disconnects the overlay (the wp_viewport "invalid destination size"
error in AprilNEA#1989), the dead socket stays readable, every loop iteration
fails and logs the same error, and the process never exits: one core
pinned and the journal flooded, with no restart by the agent.

Smithay fixed this upstream in c52f3fe ("Stop ignoring non-IO errors"),
which is not released yet. Patch the crate to that revision so GPUI's
event loop sees the error and the overlay exits; the agent then restarts
it with its normal backoff. Allow the repository in cargo-deny and pin
its Nix output hash.

This does not fix the viewport error itself, which is in GPUI.
A verbatim copy of the crates.io release (checksum 7c6ffd2d…), minus the
packaging metadata files. Nothing points at it yet; the next commit wires
it in through [patch.crates-io] together with the one change it carries,
so that change reviews as a small diff against this copy.
… scale

A fractional-scale event can reach the overlay's layer surface before the
compositor has configured its size. gpui-pre-linux then calls
wp_viewport.set_destination(0, 0), a protocol error that ends the whole
Wayland connection, so the Actions Ring never opens at any fractional
scale, on every output (AprilNEA#1989).

Patch gpui-pre-linux through a vendored copy so set_size_and_scale only
sets the viewport destination once both dimensions are positive; the
configure that assigns the real size calls back in and sets it then.
Reporters confirmed this exact guard on KWin, Hyprland and wlroots. The
patch is dropped once a gpui-pre release carries zed-industries/zed#61368.

Refs AprilNEA#1989
Move the guard in set_size_and_scale into viewport_destination, a pure
helper, and test it: a surface with either side still zero gets no
destination, and a configured one keeps its logical size. Dropping the
size check makes an_unconfigured_surface_gets_no_destination fail.

Refs AprilNEA#1989
@4ni1ak
4ni1ak force-pushed the fix/overlay-wayland-protocol-exit branch from d5de85e to 45e8bea Compare November 25, 2026 23:15
@victorhsb

Copy link
Copy Markdown

Tested the viewport size guard backported to OpenLogi 0.9.0 and confirmed the Actions Ring opens again. My test covered the guard alone. Thanks for the fix! I’d love to see it in the next release.

@wstephenson

Copy link
Copy Markdown

Now that's a coincidence. I also just tested this PR as a patch to 0.9.0.

Plasma 6.8.3, wayland, laptop panel at 125% plus a second monitor at 150%.

Before: no ring, openlogi-overlay spamming Protocol error 0 as described above.

After: the ring opens on both displays, no log spam.

Thank you!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: gui Graphical user interface needs: decision Needs a maintainer/product decision platform: linux Linux-specific issue type: bug Something is broken or behaves incorrectly

Projects

None yet

5 participants