Galaxy Shell / docs
Docs / Decisions and plans

Inverted sphere view of the canvas (the part that did not land)

openspec/changes/inverted-sphere-view/design.md · Edit on GitHub ↗

This document records decisions, plans or evidence from a project stage. It does not imply that every item is implemented or validated in the current version.

On this page

Inverted sphere view of the canvas (the part that did not land)

The landed part and the current rules are in openspec/specs/inverted-sphere-view/spec.md. The sections below are the original text of the doc, unchanged.

Status and decision record

Spec only, written on 2026-11-02 from main at 6d42715, with the fixes of review rounds 1 and 2, rebased onto main at 9cc2112 (HeroUI phase 10 and the hex crystals wallpaper spec, which change none of the compositor or core code that this spec cites), and updated with the decisions of the user on main at a351004. Phase 1 (the cylinder) is implemented; see "Phase 1 result (2026-11-02)" below. Phases 2 to 5 are not implemented. The user answered the open questions on 2026-11-02; "Decisions of 2026-11-02" at the end records the answers, and the ring (phase 3) is the design that the answer to question 2 asks for.

The user's words (2026-11-02, Portuguese, quoted)

queria ver se seria possível aplicar uma perspectiva esférica invertida, como se estivéssemos observando de dentro de uma esfera com as janelas projetadas na esfera, de forma que ao mover as janelas pelo workspace pareça que estamos girando um círculo de dentro

Feasibility verdict

Feasible, behind a protected setting that is off by default, on the Canvas layout of the primary output only. The compositor can draw the effect with the GPU tools that it already uses (an offscreen texture and a custom fragment shader, as glass.rs and workspace_depth.rs do). The pointer can land on the correct window pixel, because the warp is one closed-form function with a closed-form inverse, and the input paths already go through one screen-to-window function (Placement::to_window and Placement::focus_origin, native/smithay/src/layout.rs).

Path: phase 1 is a cylinder (horizontal curvature only) with correct targets but presses that only focus; phase 2 makes the input exact; phase 3 makes the canvas a ring that a full turn goes around (Decision 2); phase 4 adds the full sphere with the same pipeline and a different function; phase 5 is the live check. Phase 1 ships alone: it has no ring, and the lens shows the infinite flat canvas.

Main risks:

  1. Text softness. The warp resamples the flat image. Text is 1:1 only at the center of the viewport. At the sides it is magnified (1.33 times at the default angle) and softer.
  2. Breadth of the change. Hit tests, the click grab, move and resize grabs, the pan, the zoom anchor, popups, the fit and every "is this window on the screen" test read screen points or the content area. Each one must use the warp. A missed site sends a click to the wrong pixel or the keys to a window that is not drawn.
  3. Cost. Any client commit in the viewport redraws the full warp pass. Direct scanout of a full-screen canvas window stops while the warp is on.
  4. Smaller fit. The fit area is about 11 to 13 percent smaller at the default angle.
  5. Comfort. Some users find curved motion uncomfortable. Reduced motion and the setting are the way out.
  6. The ring (phase 3). A grow of the period moves the windows across the seam on the screen, and every position rule (the move grab, the fit, the row, the agent move, the pan, the restore) must take the same copy of a window. See "The ring (phase 3)".

Purpose and scope

In scope

  • A view mode of the Canvas layout (openspec/specs/canvas-windows/spec.md) on the primary output: the viewer stands at the center of a cylinder or a sphere, and the canvas windows show on its inner surface. A pan of the camera looks like a rotation of the surface around the viewer.
  • Exact pointer and gesture input on the warped windows.
  • The ring (phase 3): while the warp is on, the canvas of the workspace is periodic on the horizontal axis, so a full turn returns to the first window, and the period grows with the windows.
  • A protected setting, a compositor command with a lease, a capability and the snapshot fields.

Out of scope

  • The Grid, Focus, Monocle and Pair layouts, and a Canvas workspace on an extra output. They stay flat.
  • The chat, the bars, the screen-space panels, the wallpaper, the cursor, the lock screen, the screenshot UI and the approval dialogs. They stay flat.
  • The lens on the F9 overview, its live planes and the workspace transitions (Decision 5). They stay flat; with the ring they show the same copies of the windows (see The ring).
  • A vertical period. The vertical axis stays infinite, as the axis of the cylinder.
  • A ring on an extra output, and a ring with the warp off (Decision 6, and The ring, Unwrap rule).
  • Relative pointer, pointer constraints, touch and tablet input. The compositor implements none of them today (synthetic_input.rs maps them to UnusedEvent, and no relative pointer or constraints global exists). When one is added, it must map through the Jacobian of G and through W.
  • Any agent tool, scheduled turn, generated HTML or plugin control of the warp. This spec adds no camera authority.
  • Dragging windows between overview cards. It is never implemented (docs/architecture-decisions.md).

Model

Spaces

The canvas keeps its flat model. canvas::Camera::project (native/smithay/src/canvas.rs:122) still gives each window a flat Placement. This spec adds one screen-space map after it, on the primary output:

canvas --Camera::project--> flat point p --W--> screen point s
screen s --G = W^-1--> flat p --Camera::unproject--> canvas

W and G depend only on the camera viewport (the content area between the bars), the mode and the angle. They do not depend on the camera, so a pan, a zoom, a fit and the sharp zoom of phase 8 keep their current meaning in flat space.

The two maps

Let c be the center of the camera viewport, (u, v) = s - c in screen pixels and (X, Y) = p - c in flat pixels. Let A be the horizontal view angle of the setting and f = (viewport width / 2) / tan(A / 2) the focal length in pixels. The surface radius in canvas units is f / zoom.

Cylinder (phase 1). The axis is vertical, so vertical lines stay straight and horizontal lines bow outward at the sides:

G: X = f * atan(u / f)             Y = v * cos(atan(u / f))
W: u = f * tan(X / f)              v = Y / cos(X / f)

Sphere (phase 4). The map is azimuthal equidistant around the view axis. It has no poles in view, and it is radially symmetric, so a pan in any direction looks the same:

r = |(u, v)|      G: (X, Y) = (u, v) * f * atan(r / f) / r      (identity at r = 0)
rho = |(X, Y)|    W: (u, v) = (X, Y) * f * tan(rho / f) / rho

Decisions:

  • The center of the viewport is 1:1 (the Jacobian of G is the identity at c), so zoom 1 still means one client pixel per screen pixel where the user looks.
  • G never minifies: the Jacobian of G has no singular value above 1. So the shader samples with linear filtering, needs no mipmaps and does not alias.
  • Equirectangular longitude and latitude are rejected. They squeeze windows near the poles, and a vertical pan only slides rows along fixed latitudes, which does not look like a rotation.
  • The angle A is a setting from 20 to 90 degrees, default 60. Above 90 the side magnification passes 2 times. At 90 the half diagonal of a 1920 x 1008 viewport is about 48 degrees from the view axis. W of both maps is singular at 90 degrees from the axis (tan), far from what the view shows.
  • Zoom changes the flat scale, not the angle. A zoom by angle would change the amount of curvature during each zoom and would break the 1:1 contract at zoom 1.

Numbers at the default angle 60 on a 1920 x 1008 viewport: f is 1663 px; the side magnification of the cylinder is 1.33 horizontally and 1.15 vertically; G maps the full viewport into the flat interval |X| <= 871.

The flat point of a screen point

canvas_warp::flat_point(s) is the one function that input code calls. It is defined on the whole layout, and it is continuous:

  • q is s clamped to the primary content area. The result is c + G(q - c) + (s - q).
  • Inside the content area it is G. Outside it (a bar, an extra output) it moves 1:1 with the pointer, so a move grab that goes to the second monitor (grab_guest_elements, native/smithay/src/scene.rs) keeps tracking and makes no jump at the edge.
  • While canvas_warp::drawn() is false it is the identity.

Wraparound: a lens, then a ring

The curvature is a lens that is centered on the camera. It is a screen-space map, and it never changes with the windows.

  • Phases 1 and 2: the canvas stays infinite and flat, with its clamp of plus or minus 65536 units. A window that pans far away goes past the side of the view and does not come back.
  • Phase 3: the user asked that a full turn returns to the first window and that the ring grows with the windows (Decision 2). The canvas then becomes periodic on the horizontal axis, with a period P that the windows set, not the lens. The lens stays as it is: the curvature and the size of a window on the screen do not change when P changes. A true-radius ring (P = 2 * pi * f / zoom) is rejected: it would make the windows smaller as their count grows. See "The ring (phase 3)".

The visible region and the fit rectangle

G maps the viewport onto a flat region G(V) that is smaller than the viewport and is not a rectangle. Two functions use it:

  • canvas_warp::flat_overlaps(rect): true when a flat rectangle meets G(V), so some of it is drawn. For the cylinder G(V) is |X| <= f * A / 2 and |Y| <= (height / 2) * cos(X / f), a convex region; the test takes the X of the rectangle nearest 0 and compares the Y ranges. For the sphere the test takes the point of the rectangle nearest c and then samples of the rectangle edge; a unit test compares it with a dense raster.
  • canvas_warp::visible_flat(viewport, mode, angle) -> Rect: one definition for both modes. It is the largest rectangle centered at c, with the aspect of the viewport, whose four corners W maps inside the viewport. For both maps |W| grows with the distance from c on each axis, so the corners are sufficient. A bisection finds it. At the default on 1920 x 1008: 1680 x 882 for the cylinder, 1701 x 893 for the sphere.

canvas::fit_viewport (canvas.rs:215) and canvas::popup_area (canvas.rs:385) take visible_flat in place of the content area while the warp draws. The default size of a new canvas window (new_toplevel, native/smithay/src/handlers/xdg_shell.rs) uses the same rectangle, so the fit of a new window stays at zoom 1.

Rendering in Smithay

Chosen path: a post-process warp of the flat canvas

  1. The scene splits the stack of the primary output into warp groups. A warp group is a maximal run of consecutive canvas-space elements in the stack order (stacking_key, native/smithay/src/layers.rs). The bands go back to front: Background, Desktop, App, Floating, Hud, Unbound, Shell, Raised, Chrome, Overlay, Lock (layers.rs:31). Canvas windows, their dialogs and popups are in App and Floating. Canvas-space plugin panels are in Desktop or Hud (openspec/specs/window-layers/spec.md, space: canvas). The usual case is one group: App and Floating.
  2. Each group draws into its own offscreen texture with the current flat code (render_window_in, the corner finish of window_finish.rs, the downscale cache of sharp_zoom.rs), with a transparent background. The texture covers the flat bounding box of the group cut to the bounding box of G(V).
  3. One TextureShaderElement for each group covers W of that box. Its fragment shader (new file native/smithay/src/canvas_warp.frag when written; canvas_warp.wgsl since the wgpu scene and the only one since 2026-11-11) computes the screen pixel, applies G and samples the texture. It is compiled with compile_custom_texture_shader, as glass.frag is.
  4. Each warp element takes the stack position of its group. So a screen-space Desktop panel stays below the warped windows, a screen-space Hud panel stays above them, and the chat (Shell) and the bars stay above all of them.
  5. At most 4 groups for each frame. Canvas-space and screen-space plugin panels can alternate inside Desktop and Hud (order 0 to 15), so the count has no other bound. Over 4, the scene keeps the group of App and Floating and the 3 groups nearest to it, and the canvas-space plugin panels of the other runs draw flat at their positions for that frame.
  6. During a move grab to another output, the grab guest (grab_guest_elements, scene.rs) draws at the Floating boundary and can split the App and Floating group into two groups. This is accepted: it lasts only for the grab, and it counts toward the limit of 4.

New module native/smithay/src/canvas_warp.rs holds the maps, flat_point, flat_overlaps, visible_flat, the pipeline (the offscreen buffers, an OutputDamageTracker for each group, the program) and the element. Its pattern is GlassPipeline (native/smithay/src/glass.rs) and DepthPipeline (native/smithay/src/workspace_depth.rs). scene::elements (native/smithay/src/scene.rs:34) gets one branch in the presentations loop: while the warp is active, a canvas-space item goes to its group, not to elements.

Rejected path: a textured mesh for each window

Smithay 0.7.0 gives custom fragment shaders on a textured quad (TextureShaderElement) and pixel shaders. It has no custom vertex shader and no mesh element. A mesh needs raw GL in with_context for each surface of each window tree (the root, each subsurface, each popup), its own damage and its own opaque regions. It also loses the downscale cache, the corner finish and the popup crop of the flat path. The input still needs the same inverse. The post-process gives the same image, and its shader runs the same G that the input runs, so the drawn pixel and the clicked pixel come from one formula.

GLES2 limits and the drawn flag

  • The shader is GLSL ES 1.00 with precision highp float. atan, tan, cos and sqrt exist in GLSL ES 1.00. Medium precision (16 bit float) cannot hold a pixel position of 1920 with sub-pixel accuracy.
  • If the program does not compile (no high precision in the fragment stage, or another error), the compositor draws flat and reports canvasWarp.error.
  • Invariant: the input, the visibility tests and the fit use the warp of the last frame that the primary output drew, never the setting alone. canvas_warp::drawn() is true only after a frame drew the warp. So a failed shader, the overview or a transition never makes a click land on a pixel that the user did not see.
  • Each group texture is at most one viewport (7.7 MB in RGBA for 1920 x 1008), and groups can overlap, so the memory is at most the group count times one viewport: 7.7 MB in the usual case, 31 MB at the limit of 4 groups. The textures are freed when the warp turns off or the workspace leaves Canvas.

Damage

  • Each offscreen pass keeps per-surface damage through its own OutputDamageTracker, as the glass pipeline does.
  • The warp element is a wrapper with a stable Id and its own CommitCounter, as GlassElement (glass.rs:421-464) wraps TextureShaderElement, because TextureShaderElement::new makes a new Id on each construction and the output tracker would then damage the whole element on each frame. The counter grows only when the offscreen damage is not empty or a camera or warp value changes.
  • Phases 1 to 4: a change damages the whole element. When nothing changes, no pass runs.
  • Phase 5, only if the budget fails: the element reports the bounding box of W of each flat damage rectangle. Its four corners give that box.
  • Direct scanout of a canvas window stops while the warp draws. The frame callbacks keep their current rule (native/smithay/src/drm.rs).

What stays flat

Part Rule
Chat, composer, chat glass regions, bars, bar glass, screen-space panels Flat, at their bands. The glass pipeline renders the scene below each region into its own texture (glass.rs), so the warp shader runs again under each glass region. The budget counts that cost.
Wallpaper Below the warp, flat. The sphere view never warps the wallpaper. The hex crystals wallpaper moves its layers with the canvas camera (openspec/specs/hex-crystals-wallpaper/spec.md, Decision 3); that parallax is drawn in the wallpaper page and is separate from the warp.
Cursor, a window that a grab carries to another output Screen space, flat.
Drag and drop No drag icon is drawn today (ClientDndGrabHandler is empty, native/smithay/src/handlers/mod.rs:75). The drop target follows the pointer focus, which hit_in gives, so it needs no other mapping.
Lock screen The lock frame draws no desktop (scene.rs:43-46). No warp.
F9 overview, live overview planes, workspace transitions, thumbnail motion Flat (Decision 5). The warp turns off for their duration (drawn() is false) and on at the end. This gives a visible change at the start and the end. With the ring, they show the same copies of the windows (The ring, Overview).
Theme effects They run only in the overview (EffectTarget::OverviewF9), so no change.
A Canvas workspace on an extra output (capabilities.outputCanvas) Flat, with no ring (Decision 6).

Screenshots and captures (openspec/specs/screenshots/spec.md)

One rule: while drawn() is true, a capture of the screen gives the warped image, at any zoom.

  • original_plan (native/smithay/src/screenshot.rs:281) returns no plan while drawn() is true. The compositor then answers capture {original: true} with the output frame of the same loop, as it already does when no plan exists. So Shift+Print, which uses the original resolution on a Canvas workspace below zoom 1 (openspec/specs/screenshots/spec.md, Keys), saves the warped output frame.
  • capture.original is null for that output frame, so the core uses its output frame checks (openspec/specs/screenshots/spec.md, Original resolution, the size check of the core), not the size of the camera area. No core size change is needed.
  • The screenshot UI hides the check box "Resolução original" while the snapshot reports canvasWarp.drawn. A region is dragged on the warped screen and is a crop of the warped frame, as for any output frame.
  • Window capture and "Mostrar ao agente" stay flat: they render the window buffer alone (native/smithay/src/capture.rs). The PNG workspace previews stay flat.
  • Phase 1 updates openspec/specs/screenshots/spec.md with this rule.

Sharp zoom (phase 8 of the canvas)

The preferred buffer scale stays a function of the zoom. Part of the gain is lost: the client buffer is drawn into the flat texture at output pixels and then resampled by the warp. Above zoom 1, detail finer than one output pixel does not reach the sides, where the warp magnifies up to 1.33 times. Below zoom 1 the image is resampled twice. A higher offscreen scale at the sides is an option of phase 5, only if the user asks for it.

Input

This is the hardest part. The rule: every screen point that the code uses as a canvas or flat position goes through flat_point first; every flat point that the compositor turns back into a screen point goes through W. The pointer location (pointer.current_location(), pointer_position) stays in screen space for every target. The choice of an output (pointer_slot, pointer_canvas, canvas_mode.rs:104) stays in screen space.

Hit test and focus origin

  • Compositor::hit_in (native/smithay/src/state.rs:844) tests the shell windows above, as today, in screen space.
  • For a canvas window it tests the screen point against the content area first (in screen space), then maps the point with p = flat_point(s), then runs the current test on p: placement.contains, canvas_popup_clip and placement.to_window(p, ...). The order matters: a point on a bar maps to a flat point inside the content area.
  • hit_in also serves empty_canvas_at and pans_on_press (canvas_mode.rs:1747-1760), pointer_focus_at and refresh_pointer_focus (native/smithay/src/input.rs:349), so a press at the side pans only where no warped window is drawn.
  • The press block of the button handler (native/smithay/src/input.rs:799-830) does not go through hit_in. It focuses a window below the input threshold or a thumbnail with p.contains(pos) on the raw pointer_position, in its closures shows_at and topmost, and its takes_input filter. For a warped window it tests canvas_clip(w).contains(pos) in screen space first, as hit_in does (state.rs:858), and then p.contains(flat_point(pos)). It reads its placements from input_presented (native/smithay/src/outputs.rs:470), which stays flat.
  • Placement::focus_origin (layout.rs:51) gets the flat point and the screen point: origin = s - to_window(p) + offset. Its shortcut for scale 1 does not apply to a warped window, because the origin changes on each event even at zoom 1.
  • Smithay sends location - origin, so the client gets the exact surface-local point of the flat point under the pointer.

Visibility

Every test of "this canvas window overlaps the content area" uses flat_overlaps while drawn() is true:

  • canvas_on_screen (canvas_mode.rs:191), which the focus repair reads.
  • canvas_popup_clip (canvas_mode.rs:173).
  • show_canvas_window (canvas_mode.rs:1777), in both branches (a camera animation and a still camera). So an explicit focus of a window that is outside G(V) centers the camera on it, and the keys never go to a window that is not drawn (openspec/specs/canvas-windows/spec.md, keyboard rules).
  • The scene cull in scene::elements and the candidates of the downscale cache and of the preferred scales (sharp_zoom.rs).

Click grab, move, resize and pan

  • ScaledClickGrab (native/smithay/src/click_grab.rs) already computes the origin again on each motion. It maps the motion point with flat_point before to_window. A text selection or a scrollbar drag inside a warped window then follows the pointer.
  • begin_window_grab and begin_super_grab (native/smithay/src/grabs.rs:830, 902) keep the screen start point s0 from pointer_position. The move and resize grabs compute the canvas delta as (flat_point(s) - flat_point(s0)) / zoom, not (s - s0) / zoom. The grabbed point of the window stays under the pointer.
  • drag_window, drag_tile, drop_tile and drop_window (grabs.rs:598, 683, 727, 757) get the raw event.location. They keep it for the choice of an output. Each use of it as a canvas position (the drop onto a tile since 2026-11-11, the edge snap before) takes flat_point of it (canvas_flat_point in canvas_tile).
  • The pan by left drag, Super+left and Super+middle (begin_super_pan, native/smithay/src/desktop/canvas_mode.rs) moves the camera by (flat_point(s) - flat_point(s0)) / zoom. The grabbed canvas point stays under the pointer, so the pan feels like turning the surface by hand.
  • The 4 px dead zone and the 400 ms, 4 px double click stay in screen pixels: they measure the hand, not the canvas.
  • Two-finger scroll on empty canvas pans by the scroll delta divided by the zoom, as today. The delta is not a position, and the center scale is 1.
  • Super+scroll and pinch zoom about flat_point(pointer) and flat_point(pinch center) (Camera::zoomed, canvas.rs:171), so the point under the pointer stays fixed.
  • The edge snap threshold stayed in flat pixels divided by the zoom (history: the edge snap is removed since 2026-11-11).

Popups and the positioner

  • Popups and dialogs draw in the offscreen pass with their parent, so they warp with it. Their hit test goes through hit_in.
  • The positioner unconstrains against visible_flat in flat space (canvas_popup_target, canvas_mode.rs:1501), so a menu near the side opens fully in view.

Rules that do not change

  • The input threshold (zoom 0.5) reads the camera zoom. Below it a press on a window only focuses it.
  • The Super tap, the keyboard and the keyboard focus do not depend on a position.
  • The lock gates do not change. The three-finger swipe reads no position.

The gate test

canvas_tests.rs already walks every source file (sources, canvas_tests.rs:600-613) for every_space_location_read_is_listed_with_its_reason. A new test of the same kind fails on each call of to_window, focus_origin, Camera::unproject, Camera::zoomed, Placement::contains, canvas_clip(..).overlaps, canvas_clip(..).contains, content.overlaps or fit_viewport that does not pass through canvas_warp. Its allow list names each call that stays, with its reason. It lists at least the sites of this section: hit_in, the press block with shows_at, topmost and takes_input, focus_origin, ScaledClickGrab, begin_window_grab, begin_super_grab, drag_window, drag_tile, drop_window, drop_tile, begin_super_pan, empty_canvas_at, pans_on_press, pointer_canvas, refresh_pointer_focus, the double click, canvas_on_screen, canvas_popup_clip, show_canvas_window, canvas_popup_target and the scene cull.

The ring (phase 3)

The user's answer to question 2 (2026-11-02, quoted): "Volta completa sim, mas teria como ele ir aumentando a medida que tem mais janelas?". The user then accepted the design below ("Sim").

Model

  • The ring is a horizontal period P of the canvas of one workspace, in canvas units. The canvas points (x, y) and (x + k * P, y) are the same place for each whole k. The vertical axis stays infinite, as the axis of the cylinder.
  • The lens does not change. W and G stay screen-space maps of the camera viewport. A change of P does not change the curvature or the size of a window on the screen. So a full turn is a pan of P canvas units, not 360 degrees of the lens.
  • The windows keep their stored canvas rectangles, in the same unwrapped coordinates as today. The ring is a rule of the view: for each window the compositor picks one copy, x + k * P. So no stored field, no snapshot field of a window and no field of window-session.json changes its meaning, and the unwrap rule is simple (below).

ring_active(workspace) is true when all of these are true:

  • The canvasWarp mode is not off, the warp program compiled (canvasWarp.error is null) and the compositor has capabilities.canvasRing.
  • The workspace is in Canvas (canvas_workspace, so also in the overview over it), and the primary output shows it or no output shows it. A workspace that an extra output shows has no ring (Decision 6).
  • At least one window counts (below), and the required period is at most 2 * BOUND (131072). Over that limit (windows about 130000 units apart) the ring of that workspace is off; the lens stays. The agent cannot cause this: canvas_move refuses a move that would set R above 2 * BOUND (see Commands).

The ring does not depend on drawn() of each frame. The F9 overview, its planes and the workspace transitions turn the lens off (Decision 5), but they keep the same copies of the windows. So at the start and at the end of the overview only the curvature changes, not the place of a window. The drawn() invariant is about the lens. The copy choice is a function of the state that the drawing and the input share (canvas_placement), as the camera is today, so a click never lands on a copy that the frame did not draw.

Which windows count

The counted windows of a workspace are its canvas_rects (desktop/canvas_mode.rs:1094): application windows without a parent, on the primary output, not minimized, with a size above 0, at their client size.

  • A held window counts. It is drawn, and the ring does not move it.
  • A minimized window does not count. Its restore counts as an open.
  • Dialogs and popups do not count. They follow the copy of their root window (screen_placement, canvas_mode.rs:206, already places a dialog through the placement of its root).
  • A window on an extra output (meta.output is not Primary) does not count. A window that a move grab carries to another output counts until the drop moves it there.
  • Shell windows (the chat, the bars, panels) do not count.
  • A canvas-space plugin (plugin_canvas_rect) takes its nearest copy, as a window does. Its width counts in w_max (below), not in the span, so a plugin never grows the ring.

The period

Let minLeft and maxRight be the smallest left edge and the largest right edge of the counted rectangles, span = maxRight - minLeft, w_max the largest counted width, Vc = content width / zoom (the width of the content area in canvas units), RING_GAP = 48 canvas units (NEW_GAP) and RING_MARGIN = 96 screen pixels.

R = ceil(max(span + RING_GAP, Vc + w_max + RING_MARGIN / zoom))
  • span + RING_GAP is the extent that the windows occupy plus the gap between the last window and the first window across the seam ("P = extent + gaps").
  • The minimum is the visible width plus a margin, as the user accepted, plus w_max. Reason: a window shows twice only when the gap between its right edge and the left edge of its next copy (P - w) is smaller than the view. With the visible width alone, one wide window could show its left end at one side of the screen and its right end at the other. With w_max added, at most one copy of each window meets the view (the proof is in the copy choice).
  • Vc uses the full content area, not G(V) or visible_flat. So the rule also holds for the flat overview planes and the transitions, which show the full viewport.
  • Examples on 1920 x 1008. Zoom 1, three windows of 1200 with 48 units between them: span 3696, R = max(3744, 3216) = 3744. One window of 1200: R = 3216, so a pan of 3216 pixels returns to it. Zoom 0.25 with that window: R = 7680 + 1200 + 384 = 9264.

The origin of the strip is L = minLeft - RING_GAP / 2. The strip [L, L + P) holds every counted window. The seam is the point L, which is the same place as L + P, in the gap after the last window.

Grow and shrink

The compositor stores the period that it draws, P, not R: a new field ring: Option<canvas::Ring> of Workspace (native/smithay/src/desktop.rs:442), with the period and an optional shrink animation. ring_update(workspace) runs in the layout pass and after each command that changes a counted rectangle, the zoom or the content area.

A change of P moves only the copies with k other than 0 relative to the camera, by k times the change. The windows near the camera, which have k = 0, stay where they are (see the camera frame).

  • R above P: P grows. Cases: a window opens, is restored or grows; a move puts a window past the left or the right edge of the strip; the zoom goes down. A window that the user moves past the edge so pushes the windows across the seam ahead of it, and a new window at the end of the row moves the first window further away.
    • P first takes at once the minimum Vc + w_max + RING_MARGIN / zoom, when it is above P. This part guards the rule that a window shows once. A zoom out changes it a little in each frame (the pinch, the scroll and the 300 ms zoom animation), so the copies across the seam slide out of the view with no jump.
    • During a move or resize grab, and for an agent move, P takes R at once. The push then follows the pointer with no jump, and a moved window never overlaps the old copy of the first window.
    • In other cases (an open, a restore, a resize by the client, a row), P goes to R in 300 ms (canvas::ANIMATION, with the ease of the camera animation) when a copy with k other than 0 meets the view (the test of the shrink, below), else at once. Reduced motion and a workspace that no output shows take R at once. During this animation the gap at the seam can be smaller than RING_GAP, and a new window at the end of the row can overlap the old copy of the first window, for up to 300 ms. The drawn period is max(animated P, the minimum of that moment), so a zoom out during the animation still keeps the minimum and no window shows twice.
  • R below P: P goes to R only when both of these are true:
    1. No pointer grab, pan, pinch or camera animation runs on the workspace.
    2. No copy with k other than 0 meets the view while P moves. The test uses the frame of the camera where the stored rectangles have k = 0: cx is taken as its representative nearest the middle of the strip, and the view is [cx - Vc / 2, cx + Vc / 2], widened by RING_MARGIN / zoom on each side. For each counted rectangle and for k in {-1, +1}, the interval that the copy sweeps while the period goes from its current value to R (rect + k * P' for each P' from R to P) does not meet the widened view. This is "the leaving window is off screen": a closed, minimized or moved window, or the zoom in, never makes a copy jump in view. Then P moves to R in 300 ms (canvas::ANIMATION, with the ease of the camera animation), or at once when reduced motion is on (workspace_transitions.enabled() is false) or when no output shows the workspace. Otherwise P keeps its value, the seam gap stays wider, and a later pass tries again.
  • A grow during a shrink animation ends the animation, and the grow starts from the current value by the rules above.

The copy choice

canvas_placement (canvas_mode.rs:139) is the one function that picks the copy. While ring_active is true it projects the rectangle moved to x + k * P, with k = round((cx - (x + w / 2)) / P): the copy whose center is nearest the center of the camera. A new helper Ring::copy(rect, cx) -> Rect in native/smithay/src/canvas.rs gives it.

  • At most one copy of a window meets the view. A copy meets the view only when its center is within Vc / 2 + w / 2 of cx. The next copy is then at least P - (Vc / 2 + w / 2) away, which is more than Vc / 2 + w / 2, because P is at least Vc + w_max + RING_MARGIN / zoom. So the nearest copy is the copy that shows.
  • So "near the seam the compositor draws a window at x and x ± P" needs no second draw: each window draws once, at the copy that shows. The warp groups, their textures and the budget of the warp do not change.
  • Every consumer already reads canvas_placement or screen_placement: the scene (scene.rs:1482, 1618, 1698), the overview planes and the workspace previews, hit_in, the press block through input_presented, canvas_on_screen, canvas_popup_clip, focus_origin and the grabs. So the input takes the same copy as the drawing, and flat_point does not change: it maps the lens only.
  • The direct projections that do not go through canvas_placement take the same copy: show_canvas_window (flight.to.project, canvas_mode.rs:1797, with the cx of flight.to), settle_canvas_in (canvas_mode.rs:1718), fit_window, canvas_fit_all and the camera clamp. The gate test of phase 2 gets one more rule: a Camera::project or Camera::unproject of a canvas rectangle outside canvas_placement and canvas::Ring fails unless its allow list names it with its reason.

The camera frame and the normalization

  • normal(x) = n + (x - n) mod P, with n = max(-BOUND, min(L, BOUND - P)). The max is needed because clamp_point (canvas.rs:507) lets a window start at x = -BOUND, so L can be -BOUND - 24. The interval N = [n, n + P) lies inside [-BOUND, BOUND], because P is at most 2 * BOUND. In the usual case n is L, so the camera stays in the strip. The strip origin replaces the 0 of "keep the camera in [0, P)", because the windows keep their unwrapped coordinates.
  • The compositor sets cx to normal(cx) at the end of each camera change when no grab, pan, pinch or animation runs: after user_camera, at the end of finish_camera_flight and stop_camera_flight, at the release of a grab, and after a change of P. The shift is a whole period, so the image does not change.
  • The snapshot reports normal(cx) at all times, also during a grab or an animation. So window-session.json saves a camera in N, and the camera bound of validState (plus or minus 65536, web-shell/core/smithay.js:189) holds.
  • Camera frame rule. Before an operation ties the camera to a window, the compositor shifts cx by a whole multiple of P so that the copy of that window that shows, or the nearest copy, has k = 0. The operations: a move or resize grab (begin_window_grab, begin_super_grab, grabs.rs:830, 902), a fit (fit_window, canvas_fit), the focus centering (show_canvas_window), the agent focus, expand and restore, and fit all (the strip has k = 0). The shift is invisible. Reason: a change of P moves only copies with k other than 0. Without the rule, a window drawn at x + P that the user drags to the left past the left edge of the strip grows P by the same amount, and its copy does not move: the window would stop under a moving pointer.
  • While a grab or an animation runs, cx can leave N, but it stays inside plus or minus BOUND: Camera::at (canvas.rs:108) keeps its bound and gets no ring rule. The compositor shifts cx before it calls Camera::at, and it makes the frame shift only when the result stays inside plus or minus BOUND. In the usual case it does: N starts at L, and the shifted cx is near the grabbed window. The shift is skipped only for a window that is near the canvas bound, within about half its width plus half the view of it. When P grows during a grab with a skipped shift, the grabbed copy moves by the change, so the compositor rebases the grab: its start point becomes the current pointer position and its start rectangle the current rectangle. The next motions then move the window from where it is drawn.
  • Camera animation. Flight::sample (canvas.rs:326) interpolates from the shifted camera to the target, so the path is the short way around the ring: after the shift the target is within P / 2 of cx. A change of P during the animation moves no point with k = 0, so the target stays.
  • The pan. CanvasPan keeps its start camera, and each motion gives start.panned(delta) and then normal. P does not shrink during a pan. A grow during a pan (a window opens) moves only copies with k other than 0. Super with the middle button, the two-finger scroll and the wheel follow the same rule, through user_camera.
  • The zoom. Super+scroll, the pinch, the zoom step and the reset zoom about flat_point of the pointer as in phase 1, then ring_update grows P at once when Vc grew. A pinch never shrinks P until it ends.
  • The clamp. Camera::clamped (canvas.rs:184) gets each counted rectangle and its copies at x - P and x + P. Then a camera between the last window and the copy of the first window is near a window, as it is on the screen.

Commands and agent tools

No command is added, and no agent tool reads or sets P, the origin or the seam. The agent authority of openspec/specs/canvas-windows/spec.md, phase 7, does not change.

  • canvas_move, the agent window_action move {x, y} (canvas_mode.rs:942). The core keeps its bound of plus or minus 65536 (web-shell/core/desktop.js:412), and the compositor keeps its bound check. The compositor stores x and y as given, as today, also with a ring. With a ring, it refuses a move that would set R above 2 * BOUND with the existing refusal "Canvas position out of bounds" (canvas_mode.rs:959), so an agent move to x near 65536 with a window far on the other side cannot turn the ring off. A move past the edge of the strip then grows P by the grow rule, so a move to maxRight + 48 puts the window to the right of the last window, not onto the first window. The view still takes every position modulo P through the copy choice. The confirmation in canvasMove (web-shell/core/smithay.js:1235) stays exact, and the core reads no ring field for it. Rejected: storing normal(x). It breaks the grow rule, and it is circular, because n depends on L, which depends on the moved x.
  • canvas_fit and agent_window (canvas_mode.rs:740, 808) apply the camera frame rule and fit the nearest copy. agent_limits does not change.
  • canvas_arrange, the agent arrange_windows row and Super+G (canvas_mode.rs:888). canvas::row (canvas.rs:540) runs on the unwrapped rectangles, as today. The order of the left edges in the strip is the order on the ring from the seam, and the row starts at minLeft. P then grows at once or shrinks by the rule.
  • A new window (free_spot, canvas.rs:513, called at canvas_mode.rs:327). It runs on the unwrapped rectangles, with no copies in others: to the right of the focused window (its stored rectangle, which is the same place on the ring as the copy that shows), then past each window that it covers. A spot past the right edge grows P. show_canvas_window then shows the nearest copy of the new window.
  • The edge snap (drag_canvas, canvas_mode.rs:1040, canvas::snap). Removed on 2026-11-11: a user move ends on a tile of the visible area (openspec/specs/canvas-windows/spec.md, Tiles of a dropped window), so this item is history. Unwrapped neighbors only, with no copies. Reason: a snap to the copy of the first window across the seam at 16 units is closer than RING_GAP, so P would grow and the copy would move away at each motion.
  • set_camera (camera set and the login camera restore, canvas_mode.rs:695). The input bound stays plus or minus 65536; then cx takes normal(cx) when the ring is active.
  • canvas_restore (canvas_mode.rs:841). It stores the saved unwrapped rectangle with no change. The saved rectangle was never wrapped.
  • The desktop_state description says: on a ring (canvasRings), x and x plus or minus the period are the same place on the screen; a move stores x as given, and a move past the last window makes the ring larger.

Unwrap rule (warp off and on)

The windows keep their unwrapped coordinates, so nothing is stored wrapped.

  • The ring turns off (the setting goes to off, a warp error, the workspace leaves Canvas or goes to an extra output, the lease ends, or R passes 2 * BOUND through a user move, an open or a restore). No window rectangle changes. The camera shifts by a whole multiple of P so that the window with the keyboard (else the counted window nearest the center of the view) has k = 0 and keeps its place on the screen. Then the lens turns off as in phase 1 when the warp turns off; when only the ring turns off (R over 2 * BOUND, an extra output), the lens stays where it draws. A window that showed through another copy goes back to its stored place, off the screen or at the other side of the view. The keyboard window stays drawn, so the focus repair does not move the keys.
  • The ring turns on. P takes R, and cx takes normal(cx). No window moves. Copies appear in what was empty canvas.
  • The login restore (window-session.json, web-shell/core/window-session.js) needs no format change. A stored rectangle and a camera in N give the same view with the ring on and off, except for the copies. The order of canvas_restore, camera restore and syncCanvasWarp does not matter.
  • A rollback to a compositor without the ring is the same as off.

Overview, transitions, previews and screenshots

  • The F9 overview planes and the workspace transitions stay flat (Decision 5), with the copy choice of the ring. Each plane shows the flat view of the camera of its workspace with the copies, not the unwrapped strip. Reason: the plane then matches the view before and after the overview; only the curvature changes.
  • The workspace overview cards (the PNG previews of workspace_preview.rs) read screen_placement, so they show the same copies, flat.
  • Screenshots. The output frame shows each window once, at the copy that the frame drew. A region across the seam is a crop of that frame. The window capture and "Mostrar ao agente" render the window buffer, with no change.
  • Extra outputs stay flat and infinite, with no ring (Decision 6).

Snapshot, capability and version skew

  • capabilities.canvasRing (boolean).
  • A new top-level field canvasRings: an array of at most 100 entries {workspace, origin, period}, one for each workspace whose ring is active, else empty. origin is n of N.
  • Not inside the entries of canvasWorkspaces: validState checks their exact keys (camera,chatDock,workspace, web-shell/core/smithay.js:180), so a core of phase 2 would refuse the whole state after a rollback of the core. Not inside canvasWarp, for the same reason with the check of phase 1.
  • validState refuses a capability that is not a boolean, more than 100 entries, a workspace that is not a safe integer of 1 or more, an origin that is not a safe integer within plus or minus 2 * BOUND, and a period that is not a safe integer from 1 to 2 * BOUND.
  • Phase 3 runs the validState of the core on main before phase 3 against a snapshot with canvasRings and the capability, as phase 1 does for canvasWarp.

Tests

Cargo, native/smithay/src/canvas.rs (pure functions of canvas::Ring):

  • normal gives a value in N for x across plus or minus 3 * P, is idempotent and keeps x modulo P. N stays inside plus or minus BOUND for P up to 2 * BOUND, and n is L in the usual case.
  • R: span + RING_GAP; the minimum with w_max and the margin at zoom 0.1, 1 and 2; one window; no ring over 2 * BOUND; no ring without a counted window.
  • The copy choice: the nearest copy center. A property test over a grid of window layouts, cameras and zooms: at most one copy of each window meets the view interval, also for the full content area of the overview planes.

Cargo, canvas_tests.rs, pointer_focus_tests.rs and window_grab_tests.rs (the compositor):

  • Grow: a move grab past the right edge and past the left edge (L moves) sets P to R at once; a zoom out sets the minimum at once; an open, a restore and an agent move with a copy with k other than 0 in view move P to R in 300 ms, and at once with no such copy in view or with reduced motion. Windows with k = 0 keep their screen place; copies with k other than 0 move by the change.
  • Shrink: the swept-copy test for k in {-1, +1} in the frame of the camera, including a copy that would cross the view while P moves. A close of a window that is off the screen moves P to R in 300 ms. A close at the seam in view keeps P. The shrink waits for a grab, a pan, a pinch and an animation. Reduced motion shrinks at once. A grow during a shrink ends it.
  • The camera frame: a move grab of a window drawn at x + P to the left past the edge of the strip keeps the grabbed point under the pointer at each motion. A resize grab at the seam does the same.
  • Input at the seam: a press on a copy at x + P and at x - P lands on the correct surface-local point at zoom 0.5, 1 and 1.5. A press in the seam gap pans. A press at the edge between the last window and the copy of the first hits the window that is drawn there. A popup of a copy opens at that copy.
  • show_canvas_window: a window whose nearest copy is off the screen centers the camera on that copy the short way (|change of cx| at most P / 2), and canvas_on_screen is then true.
  • Fit, fit all, the settle and the clamp take the copy; an animation from the shifted camera ends at the target while P changes.
  • canvas_move that would set R above 2 * BOUND (a window at x = -60000 and a move to x = 65536) is refused with "Canvas position out of bounds", and the ring and the lens stay.
  • A zoom out during an animated grow draws max(animated P, minimum): no window meets the view twice in any frame.
  • A grab with a skipped frame shift near the bound rebases when P grows: the grabbed point stays under the pointer at the next motion.
  • canvas_move to maxRight + 48 stores that x, puts the window to the right of the last window and grows P; the held window, the bounds and the lock refusals stay. A row on the ring starts at minLeft.
  • normal with a window at x = -BOUND: n is -BOUND, and normal(cx) stays inside plus or minus BOUND.
  • Unwrap: the ring off keeps every rectangle, and the keyboard window keeps its screen place; the ring on keeps cx modulo P.
  • Snapshot: canvasRings keys and bounds; the camera x stays within plus or minus 65536 during a grab and an animation.

Node, web-shell/test:

  • validState accepts and refuses canvasRings and the capability as above; the core of phase 2 accepts a snapshot with them.
  • window-session: a record saved with a ring restores the stored rectangles and the camera with the ring on and off.

Nested QA (scripts/nested-qa.py, --setting canvasWarp=cylinder, nested proof only):

  • Open three test clients. Pan to the right by more than P with Super and the middle button and with scroll on empty canvas. Check in state that cx stays in N and that the first window shows again. Capture at the seam: each window shows once.
  • Open a fourth window: canvasRings reports a larger period. Close a window that is off the screen: the period goes down after 300 ms. Close one at the seam in view: the period stays.
  • Move a window past the right edge with Super and the left button: the period grows, and the copy of the first window moves ahead of it. With the client that prints the surface-local point of each press, press a copy at the seam.
  • Zoom out to 0.25 and to 0.1: no window shows twice in the capture.
  • An agent-equivalent canvas_move through the control socket of the nested session with an x past the last window: the stored x is that x, and the period grows at once. With one window at x = -60000, a canvas_move of another window to x = 65536 is refused with "Canvas position out of bounds", and canvasWarp.drawn and canvasRings stay.
  • Open the F9 overview at the seam: the plane shows the copies. Turn the setting off: every rectangle in state stays, and the focused window keeps its place.
  • Stop every nested run and every test core that you start.

Performance acceptance

Target: the primary output at 1920 x 1080 and 60 Hz on an integrated GPU, with a second output connected (the warp draws on the primary output only). Measured with frame_timing (RUST_LOG=frame_timing=info). The budgets are those of openspec/specs/canvas-windows/spec.md (Performance budget: 8 ms and 12 ms at p95) plus 1.5 ms for the warp, including the second warp sample under the glass regions. The 1.5 ms is an estimate for one group (one viewport write and one full-viewport sample), not a measurement; phase 1 measures it, and each extra group adds about the same. Nested numbers only point in a direction; the live check decides.

Case Budget
Still camera, no client commit No warp pass; the output tracker reports empty damage. Render time as flat Canvas.
Still camera, one client commit per frame (a video or a terminal) Primary output render time at p95 at most 1.5 ms above flat Canvas with the same windows.
Camera animation or pan, 12 windows p95 of 9.5 ms (8 + 1.5) or less; no dropped frame at 60 Hz.
Fit all, 20 windows p95 of 13.5 ms (12 + 1.5) or less.
Extra output during a pan No added damage, as in the canvas budget.
Pan, 12 windows, 1 warp group (the usual case) Within the 9.5 ms row.
Pan, 12 windows, 3 warp groups (canvas-space Desktop and Hud plugins) p95 of 11 ms or less; no dropped frame at 60 Hz.
Texture memory Group count times one viewport (7.7 MB at 1920 x 1008 for one group, 23 MB for 3).
Input flat_point under 20 microseconds for each event, measured once with a release build and recorded in the work log.
Ring (phase 3) ring_update with 20 windows under 20 microseconds for each layout pass; the copy choice adds no draw and no warp group.

If a row fails, the warp does not become available to the user outside QA, and phase 5 adds the per-rectangle damage.

Phases

  1. Phase 0: this document. Rollback: revert the commit.
  2. Phase 1, cylinder view with correct targets. canvas_warp.rs (the maps, flat_point, flat_overlaps, visible_flat), the shader, the pipeline and the warp groups, the command, the lease, the capability, validState, syncCanvasWarp, the setting route and the settings control. The warped hit_in, the press block of the button handler (with input_presented), and every visibility site of the Input section, the fit and the new window size, and the screenshot rule. While the warp draws, a press on a canvas window only focuses the window that is drawn there, and scroll over it does not reach the client (the rule of a window below the input threshold). The pan and the zoom use flat_point. Purpose: the user judges the look and the motion before the exact input.
  3. Phase 2, exact input. The focus origin, ScaledClickGrab, the move, resize, drag and drop grabs, popups and the positioner. Remove the phase 1 press rule. Add the gate test.
  4. Phase 3, the ring. canvas::Ring (the period, the origin, normal, the copy choice, grow and shrink), Workspace.ring, ring_update, the copy in canvas_placement and in the direct projections, the camera frame rule, the modular rules of each command, the unwrap rule, canvasRings and capabilities.canvasRing, the core check of validState, and the ring tests. It needs phase 2: a move grab across the seam must keep the grabbed point under the pointer. Rollback: turn the warp off (the unwrap rule), then revert; no saved field changes.
  5. Phase 4, sphere. The second map, its flat_overlaps, and sphere in the setting. The ring stays horizontal.
  6. Phase 5, live check with the user: the budget on the real GPU, the touchpad pan and pinch, the comfort of the motion and of a ring grow, two monitors, the readability criterion of Decision 4, per-rectangle damage and a sharper side, only if needed. The overview and the transitions stay flat (Decision 5) unless the user asks again after this check.

Phase 1 result (2026-11-02)

Phase 1 is in native/smithay/src/canvas_warp.rs (the maps, the lens, the pipeline, the warp element and the command), canvas_warp.frag (the shader, deleted 2026-11-11; canvas_warp.wgsl and plain_warp.rs draw it now) and canvas_warp_tests.rs (the scene and input tests), with the call sites in state.rs, scene.rs, desktop.rs, desktop/canvas_mode.rs, desktop/snapshot.rs, ipc.rs, screenshot.rs and handlers/xdg_shell.rs. The core has canvasWarpSetting, the validState checks, setCanvasWarp and syncCanvasWarp (web-shell/core/smithay.js), the route /api/canvas-warp (server.js) and the settings control (a switch and an angle select in the Canvas section of the HeroUI settings). scripts/nested-qa.py start --setting canvasWarp=cylinder[:ANGLE] seeds it.

What differs from the text above:

  • Correction: the cylinder map G is not a pure minification. Its Jacobian has a shear term away from the axes, so its largest singular value is above 1 near the corners: 1.008 at 60 degrees and 1.026 at 90 degrees on 1920 x 1008. Each axis alone is at most 1. The unit test checks both bounds (1.03, and 1 for each axis). The sampling of the flat texture stays linear, and the effect is not visible.
  • flat_point is 1:1 outside the viewport for a motion away from the edge. A motion along the edge goes through G of the clamped point, so it is not 1:1; the test moves the pointer horizontally.
  • The texture of a warp group covers the bounding box of G(V) (whole pixels inside the viewport), not the bounding box of the group cut to G(V). Memory stays within one viewport for each group.
  • The limit of 4 counts runs of warped items (warped_runs): the run with the most canvas windows and the 3 runs nearest to it. A grab that splits a run in the scene can give more than 4 groups in one frame.
  • A canvas-space plugin inside a warp group gets no glass of its own.
  • Scroll over a warped window reaches no client and does not pan (the window is under the pointer, so the empty-canvas rule does not apply). Over an empty part of the canvas, scroll pans as before.
  • The compositor serde refuses sphere as an unknown mode. The core also refuses it in the setting and in --setting; a snapshot from a later compositor with sphere passes validState.
  • The angle is a whole number of degrees. The settings offer 30, 45, 60, 75 and 90 (and a saved angle outside this list).
  • The order of screen-space Desktop and Hud panels around the warp groups has a unit test of the run split (warped_runs), not a render test.
  • Found in nested QA: the corner finish (window_finish) masks a window with bounds in framebuffer pixels, so in the group texture it cut a left and a top strip of each window, of the size of the flat box offset. The pipeline now moves the finish bounds by the offset of the group texture while it renders the group, and back after it (shift_finish). An EGL test (egl_a_finished_window_keeps_its_left_and_top_in_the_group) fails without the fix.
  • The flat box offset uses the logical pixels of the content area as framebuffer pixels. The compositor draws the primary output at scale 1 today; a fractional output scale is not verified.

Review round 1 (2026-11-02):

  • The lens is only for the windows that the last frame drew warped. A canvas item of a run over the limit of 4 draws flat, and the frame records its root (CanvasWarp::flat), so window_lens gives it no lens and its input is flat too. A test with 5 runs presses such an item.
  • Off clears the error of a failed shader or group, also when no program exists, so the next mode other than off compiles again. The settings show the error of the snapshot below the note of the lens (#canvas-warp-error).
  • A press with Super, or a window grab, on a warped window starts no move or resize ("The canvas warp draws the window"); phase 1 maps no grab motion through the lens.
  • The core logs a saved canvasWarp that is not valid before it turns the warp off.
  • Accepted: when a warp group fails in close_group, the groups of the same frame that closed before it stay warped for that one frame, while the input of that frame is already flat (the error clears the lens). The next frame draws flat. A press in that one frame can land on the flat position of a window that shows warped.
  • The still-camera EGL test renders the second frame through the same OutputDamageTracker and checks that it has no damage.
  • The gate test also gates each canvas_clip( call, with its allowed count. The popup positioner (desktop/canvas_mode.rs) is allowed and stays flat until phase 2.
  • The hit test through the lens has a test at zoom 0.5 and 1.5.
  • Deferred to phase 2: a render test of the stack order of the screen-space panels around the warp groups (only warped_runs has a test).
  • The gates of a compositor change include the ignored GPU tests: scripts/prepare-project.py --cargo test --locked --features session -- --ignored native_wgpu_ (openspec/specs/project-loading/spec.md; the egl_ GLES tests of the lens went on 2026-11-11).

Review round 2 (2026-11-02, no HIGH or MEDIUM):

  • The lens is per window. The frame records the ids of the presented windows that it drew warped (CanvasWarp::warped, warped_presentations), and window_lens gives the lens only to a window in that set. A dialog in another run than its root takes its own input, and a window mapped after the last frame is flat until a frame draws it. The visibility tests (canvas_shows, the culling of the presentations) use canvas_item_lens, which does not depend on the runs of the last frame, so the culling cannot change the runs that change the culling.
  • A move or resize grab checks the root and its dialogs (warp_draws_family): it is refused when the frame drew one of them warped, and a grab that started flat ends at the first motion after a frame draws one of them warped (grab_continues).
  • The core logs each saved canvasWarp that is not valid once, not on every state poll.
  • Accepted: a frame that warps no canvas item (an empty part of the canvas in view) still reports its lens, so the pan and zoom anchors and the fit area still go through the lens. The empty canvas looks the same flat or warped, the anchors stay the same when a window comes into the view, and a lens that follows the item count would switch the culling test each frame (a window just outside G(V) but inside the content area).

Docs that each phase updates: openspec/specs/canvas-windows/spec.md (a pointer to this file), openspec/specs/screenshots/spec.md (phase 1), openspec/specs/web-panels/spec.md and openspec/specs/window-layers/spec.md (the warp groups and canvas-space plugins, phase 1), docs/nested-qa.md (the new --setting, phase 1), docs/architecture-decisions.md (a dated entry, phase 1; the ring, phase 3) and the AGENTS.md boundaries (one entry for canvasWarp: protected setting, no agent or generated HTML control, the lease, phase 1; the ring and the modular agent move, phase 3). Phase 3 also updates the canvas rules of openspec/specs/canvas-windows/spec.md (the move, the row, the fit, the camera and the restore on a ring) and the desktop_state and window_action descriptions in web-shell/core/desktop.js.

Delivery follows AGENTS.md. Each phase is a branch in a worktree, rebased on origin/main, with the npm, Python and Rust gates (scripts/prepare-project.py --cargo). Then these are separate steps, each recorded: publish to main; synchronize and build the active checkout (scripts/sync-active-checkout.py); the next login; and the real activation of the setting by the user. A compositor phase takes effect only at a new login.

Tests

In-process (cargo and node, each phase)

  • Round trip W(G(s)) = s and G(W(p)) = p within 1e-6 px on a grid of points over 1280 x 720, 1920 x 1008 and 3840 x 2112 viewports, for angles 20, 60 and 90, for both maps.
  • G is the identity at the center, its Jacobian is the identity there, and no singular value of its Jacobian is above 1.
  • flat_point is continuous at the edge of the content area, moves 1:1 outside it, and is the identity while drawn() is false. A move grab that crosses to the second output keeps the grabbed point under the pointer.
  • visible_flat for each mode: W of its four corners is inside the viewport, and the same rectangle 1 px larger is not. flat_overlaps agrees with a dense raster of G(V) for each mode.
  • A GPU test (as native_wgpu_depth_blurs_only_moving_cards_and_lands_pixel_sharp in wgpu_renderer_workspace_tests.rs; its GLES original egl_depth_... in workspace_depth.rs was deleted 2026-11-11) draws a known pattern through the shader, reads it back, and compares sample pixels with G in Rust within 1 px.
  • A failed shader compile draws flat, sets error, and keeps drawn() false; the hit test then stays flat.
  • Two frames with a still camera and no commit give empty damage on the output tracker.
  • Stack order: a screen-space Desktop panel draws below the warped windows, a screen-space Hud panel above them, a canvas-space Desktop and Hud panel each in its own warp group at its band, and the chat above all of them. With 5 alternating runs, 4 groups draw warped and the canvas-space panels of the fifth run draw flat; the App and Floating group is always warped.
  • pointer_focus_tests.rs and window_grab_tests.rs: synthetic warped placements at zoom 0.5, 1 and 1.5. A press at the center, at each side and at each corner of a window lands on the surface-local point of G. A click grab drag at the side gives the correct local delta. A move grab keeps the grabbed point under the pointer. A point on a bar never hits a canvas window. A press at the side between two windows pans only where no window is drawn. Phase 1: a press at the side between two warped windows below the input threshold focuses the window that is drawn there (the press block), and a press on the gap focuses none.
  • Visibility: a window that overlaps the content area but not G(V) is not on the screen for canvas_on_screen, and its explicit focus moves the camera.
  • The pan keeps the grabbed canvas point under the pointer; Super+scroll keeps the point under the pointer fixed.
  • A popup near the side unconstrains inside visible_flat.
  • Screenshots: original_plan gives no plan while drawn() is true.
  • While locked, canvas_warp with mode cylinder is accepted and with mode off is refused; an unknown mode or angle is refused; mode off disables the lease; the lease turns the warp off after the grace time and keeps it with a new sender within it.
  • Node, web-shell/test/smithay.test.js: validState accepts the new fields and refuses each bad value above; syncCanvasWarp sends the command after a connect and when the snapshot differs, and sends nothing to a compositor without the capability.
  • The gate test with its allow list.

Nested QA (scripts/nested-qa.py, nested proof only)

  • Add --setting canvasWarp=off|cylinder|sphere to scripts/nested-qa.py (when this was written it accepted only workspaceOutputs and canvas; since 2026-11-03 it accepts canvas and canvasWarp).
  • Phase 1: capture at zoom 0.5, 1 and 1.5 while the camera pans, and check that the chat, the bars and the cursor stay flat. Check that a press at the side focuses the window drawn there. Record frame_timing during a pan. Take Shift+Print below zoom 1 and check a warped image.
  • Phase 2: with a test client that prints the surface-local point of each press (add one if none exists), click nine points of one window (center, sides, corners) and compare with G. Type text, select text with a drag at the side, open a menu near the side, move and resize a window with Super+left and Super+right, pan with a drag and check in state that the camera follows G.
  • Phase 3: the ring steps in "The ring (phase 3)", Tests.
  • Phase 4: the same as phase 2 for sphere, with presses near the top and bottom corners, and the ring steps again.
  • Readability: measure the sharpness metric of the sharp zoom run (the top 2 % horizontal gradient over the contrast, docs/work-log-2026-11.md, run 2dd04ab4) on the same text at the center and at a side, with the warp on and off.
  • Stop every nested run and every test core that you start.

Live check with the user (phase 5, under coordination.lock)

The budget on the real GPU, the touchpad pan and pinch, the comfort of the motion and of a ring grow, a full turn on the ring, two monitors and the readability of text at the sides.

Decisions of 2026-11-02

The user answered the seven open questions on 2026-11-02. Question 2 got its own answer and the ring design; the other six take the defaults of this spec.

  1. Cylinder or sphere: the cylinder first (phase 1), the sphere in phase 4 with the same pipeline.
  2. A full turn returns to the first window: yes, and the ring grows with the windows ("Volta completa sim, mas teria como ele ir aumentando a medida que tem mais janelas?"). The user accepted the design ("Sim"): the canvas is periodic on the horizontal axis only, with a period P that the windows set; the lens stays a screen-space lens, so the curvature and the window size do not change with P; P is the extent of the windows plus the gaps, with a minimum of the visible width plus a margin; P grows (this spec animates a grow in 300 ms when a copy across the seam shows, except the minimum and a grab, which take it at once) and shrinks with a short animation only off the screen; near the seam a window draws at x or x ± P, and the input uses the same rule; every position rule takes the position modulo P; the vertical axis stays infinite; with the warp off the canvas stays flat and infinite. See "The ring (phase 3)". This spec adds the widest window to the minimum, so one window never shows twice, and keeps the ring through the flat overview, so the windows keep their places there.

To confirm with the user at the live check (phase 5):

  • The visible push: when the period grows (a window opens at the end of the row, or a move past the edge), the windows across the seam move away on the screen, in 300 ms or with the pointer. During the 300 ms a new window can overlap the old copy of the first window.
  • The ring stays through the flat overview and transitions, not only while the lens draws.
  • The camera stays in the strip N that starts near the first window, not in [0, P), because the windows keep their stored coordinates.
  1. The strength of the curvature: a 60 degree view by default, adjustable from 20 to 90 degrees.
  2. Softer text at the sides is accepted, with the criterion: at the default angle, the sharpness metric of text at a side is at least 0.75 of the same text at the center. Text at the center stays 1:1. Phase 1 nested QA measures it, and phase 5 checks it live.
  3. The F9 overview, its planes and the workspace transitions stay flat. The lens turns off for their duration and on at their end.
  4. The primary output only. A Canvas workspace on an extra output stays flat, with no ring.
  5. While the warp draws, every screen capture saves the warped image, and the screenshot UI hides "Resolução original".