Skip to content

Annotate can't draw on GNOME Wayland: capsule and ink need XWayland (Hex lab + one-line Rune fix) #1526

Closed

Description

@pkkid

Hex version

3.3.0 (installed RPM), and a local build of dev at 2276151 with the change below.

Platform

Linux, GNOME on Wayland

System details

Fedora 45, GNOME Shell 51.1 (Mutter, no layer-shell), XWayland running, one 3440x1440 monitor at scale 1, NVIDIA RTX 4090.

What happened?

On GNOME Wayland, Annotate records but you can't draw. Mutter has no zwlr_layer_shell_v1, and both the recording capsule (with the pen) and the ink overlay take pointer input, so Rune can't open either of them. A capture records the screen and the narration with nothing on screen to draw on. The log only shows HUD shows on XWayland: compositor has no layer-shell.

The dictation HUD already falls back to XWayland there, and the meeting capsules do too behind Labs › Floating meeting capsules on GNOME (#1274). Annotate has no such path.

Working implementation

Branch: https://github.com/pkkid/hex/tree/linux-annotate-gnome-xwayland
Commit: pkkid@fdd33d6 (one commit on top of dev at 2276151)

It adds Labs › Annotate on GNOME (gnome-annotate, labs.gnome_annotate, Linux only, group Annotate, off by default) and follows the meeting capsules' rules:

  • The capsule and ink overlay float on XWayland through OverlayOptions::xwayland_input, but only with the lab on, on a Wayland session without layer-shell, and only while this user's XWayland already runs. Hex decides this at each show and never starts XWayland (linux/annotate_overlays.rs, reusing linux/meeting_capsules.rs's check).
  • On that path the ink overlay uses KeyPolicy::None, because Rune never shows an overlay that asks for keys on XWayland. So Esc can't stop the pen on GNOME; the capsule's pen or a tap of the Annotate key still does.
  • The ink overlay takes OverlayInput::Regions from the start there, with no regions while not drawing. An XWayland window created click-through has no event watch and can't take the pointer later.
  • Includes the Labs card, hex settings key, translations, the feature-map docs, AGENTS.md, and the rune-linux-labs-light golden. The golden was rendered on lavapipe, and the commit includes only that image.

It also needs a one-line fix in Rune

Filed as anomalyco/rune#276. It finishes anomalyco/rune#85, the Rune issue that added interactive XWayland overlays for Hex's meeting capsules and Annotate.

With only the Hex change, the capsule shows on GNOME but none of its buttons take clicks, and the pen needs one click before it starts drawing. Inspecting the X windows during a capture showed the cause: Hex capture had an empty input shape (0 rectangles), while Hex ink got its rectangles only after a while.

In crates/rune/src/overlay/draw.rs, the drawn-frame path publishes hit regions for macOS, Windows, X11 and layer-shell, but not for an XWayland backing. Backing::Xwayland gets regions only from apply_input, unchanged_frame and warm_frame. A capsule that redraws every second (its clock) never reaches those, so it keeps the empty shape it was created with. The fix, beside the layer-shell line, at Hex's pinned rev 53c7f60f (Rune's dev at ba32e19f has the same gap):

         if let Backing::Layer(layer) = &live.backing { layer.input_regions(self.rt.hit_regions(), self.interactive); }
+        // An XWayland window's input shape follows the frame just laid out too; without it a
+        // redrawing overlay kept the empty shape it was made with and took no clicks.
+        #[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios"), not(target_os = "android")))]
+        if let Backing::Xwayland(surface) = &mut live.backing { surface.regions(self.rt.hit_regions()); }
         let target_format = ...

XwaylandSurface::regions already skips unchanged shapes, so running it every frame is cheap. This probably affects the opt-in meeting capsules on GNOME as well, since they redraw too.

With both changes applied (Rune patched locally through cargo --config patch), it works on the system above: the capsule's buttons click, the pen draws on the first drag, holding the Annotate key draws, and the strokes land in the capture. The one gap is that Esc doesn't stop the pen, which is expected on XWayland.

The Hex branch is ready to go once Rune has the fix and Hex's pin is bumped. Until then the lab shows the capsule but its buttons don't respond.

Steps to reproduce

  1. GNOME on Wayland, with Annotate on and XWayland running.
  2. Tap F9 to start a capture: no capsule or ink appears (on dev).
  3. With the branch above and hex labs on gnome-annotate: the capsule shows, but its pen, stop and ✕ don't respond until the Rune line is added.

🤖 Generated with Claude Code

Activity

  1. thdxr commented on Nov 8, 2026

    @thdxr
    Member

    on gnome wayland, annotate recorded the screen but the recording capsule and the pen/ink layer never showed, so you couldn't draw.

    it's behind a labs toggle now: "annotate on gnome" (labs › annotate, off by default, or hex labs on gnome-annotate). with it on and xwayland already running, the capsule and pen float on screen so you can draw.

    • floating windows on that path take clicks on their buttons now too, including the gnome floating meeting capsules lab. thanks for chasing down the click bug.
    • one limit: esc can't stop drawing there. use the capsule's pen button or let go of a held annotate key.

    fixed in #1529, it'll be in the next dev build
    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions