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:
- 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.
- 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.
- 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.
- Smaller fit. The fit area is about 11 to 13 percent smaller at the default angle.
- Comfort. Some users find curved motion uncomfortable. Reduced motion and the setting are the way out.
- 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 ofGand throughW. - 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
Gis the identity atc), so zoom 1 still means one client pixel per screen pixel where the user looks. Gnever minifies: the Jacobian ofGhas 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
Ais 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.Wof 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:
qissclamped to the primary content area. The result isc + 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
Pthat 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 whenPchanges. 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 meetsG(V), so some of it is drawn. For the cylinderG(V)is|X| <= f * A / 2and|Y| <= (height / 2) * cos(X / f), a convex region; the test takes theXof the rectangle nearest 0 and compares theYranges. For the sphere the test takes the point of the rectangle nearestcand 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 atc, with the aspect of the viewport, whose four cornersWmaps inside the viewport. For both maps|W|grows with the distance fromcon 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
- 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. - Each group draws into its own offscreen texture with the current flat code (
render_window_in, the corner finish ofwindow_finish.rs, the downscale cache ofsharp_zoom.rs), with a transparent background. The texture covers the flat bounding box of the group cut to the bounding box ofG(V). - One
TextureShaderElementfor each group coversWof that box. Its fragment shader (new filenative/smithay/src/canvas_warp.fragwhen written;canvas_warp.wgslsince the wgpu scene and the only one since 2026-11-11) computes the screen pixel, appliesGand samples the texture. It is compiled withcompile_custom_texture_shader, asglass.fragis. - 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.
- 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.
- 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,cosandsqrtexist 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
Idand its ownCommitCounter, asGlassElement(glass.rs:421-464) wrapsTextureShaderElement, becauseTextureShaderElement::newmakes a newIdon 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
Wof 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 whiledrawn()is true. The compositor then answerscapture {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.originalis 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 onp:placement.contains,canvas_popup_clipandplacement.to_window(p, ...). The order matters: a point on a bar maps to a flat point inside the content area. hit_inalso servesempty_canvas_atandpans_on_press(canvas_mode.rs:1747-1760),pointer_focus_atandrefresh_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 withp.contains(pos)on the rawpointer_position, in its closuresshows_atandtopmost, and itstakes_inputfilter. For a warped window it testscanvas_clip(w).contains(pos)in screen space first, ashit_indoes (state.rs:858), and thenp.contains(flat_point(pos)). It reads its placements frominput_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 outsideG(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::elementsand 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 withflat_pointbeforeto_window. A text selection or a scrollbar drag inside a warped window then follows the pointer.begin_window_grabandbegin_super_grab(native/smithay/src/grabs.rs:830, 902) keep the screen start points0frompointer_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_tileanddrop_window(grabs.rs:598, 683, 727, 757) get the rawevent.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) takesflat_pointof it (canvas_flat_pointincanvas_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)andflat_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_flatin 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
Pof the canvas of one workspace, in canvas units. The canvas points(x, y)and(x + k * P, y)are the same place for each wholek. The vertical axis stays infinite, as the axis of the cylinder. - The lens does not change.
WandGstay screen-space maps of the camera viewport. A change ofPdoes not change the curvature or the size of a window on the screen. So a full turn is a pan ofPcanvas 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
canvasWarpmode is notoff, the warp program compiled (canvasWarp.erroris null) and the compositor hascapabilities.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_moverefuses a move that would setRabove2 * 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.outputis notPrimary) 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 inw_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_GAPis 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. Withw_maxadded, at most one copy of each window meets the view (the proof is in the copy choice). Vcuses the full content area, notG(V)orvisible_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).
RaboveP:Pgrows. 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.Pfirst takes at once the minimumVc + w_max + RING_MARGIN / zoom, when it is aboveP. 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,PtakesRat 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),
Pgoes toRin 300 ms (canvas::ANIMATION, with the ease of the camera animation) when a copy withkother than 0 meets the view (the test of the shrink, below), else at once. Reduced motion and a workspace that no output shows takeRat once. During this animation the gap at the seam can be smaller thanRING_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 ismax(animated P, the minimum of that moment), so a zoom out during the animation still keeps the minimum and no window shows twice.
RbelowP:Pgoes toRonly when both of these are true:- No pointer grab, pan, pinch or camera animation runs on the workspace.
- No copy with
kother than 0 meets the view whilePmoves. The test uses the frame of the camera where the stored rectangles havek = 0:cxis taken as its representative nearest the middle of the strip, and the view is[cx - Vc / 2, cx + Vc / 2], widened byRING_MARGIN / zoomon each side. For each counted rectangle and forkin {-1, +1}, the interval that the copy sweeps while the period goes from its current value toR(rect + k * P'for eachP'fromRtoP) 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. ThenPmoves toRin 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. OtherwisePkeeps 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 / 2ofcx. The next copy is then at leastP - (Vc / 2 + w / 2)away, which is more thanVc / 2 + w / 2, becausePis at leastVc + 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_placementorscreen_placement: the scene (scene.rs:1482, 1618, 1698), the overview planes and the workspace previews,hit_in, the press block throughinput_presented,canvas_on_screen,canvas_popup_clip,focus_originand the grabs. So the input takes the same copy as the drawing, andflat_pointdoes not change: it maps the lens only. - The direct projections that do not go through
canvas_placementtake the same copy:show_canvas_window(flight.to.project, canvas_mode.rs:1797, with thecxofflight.to),settle_canvas_in(canvas_mode.rs:1718),fit_window,canvas_fit_alland the camera clamp. The gate test of phase 2 gets one more rule: aCamera::projectorCamera::unprojectof a canvas rectangle outsidecanvas_placementandcanvas::Ringfails unless its allow list names it with its reason.
The camera frame and the normalization
normal(x) = n + (x - n) mod P, withn = max(-BOUND, min(L, BOUND - P)). Themaxis needed becauseclamp_point(canvas.rs:507) lets a window start atx = -BOUND, soLcan be-BOUND - 24. The intervalN = [n, n + P)lies inside[-BOUND, BOUND], becausePis at most2 * BOUND. In the usual casenisL, 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
cxtonormal(cx)at the end of each camera change when no grab, pan, pinch or animation runs: afteruser_camera, at the end offinish_camera_flightandstop_camera_flight, at the release of a grab, and after a change ofP. 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 inN, and the camera bound ofvalidState(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
cxby a whole multiple ofPso that the copy of that window that shows, or the nearest copy, hask = 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 agentfocus,expandandrestore, and fit all (the strip hask = 0). The shift is invisible. Reason: a change ofPmoves only copies withkother than 0. Without the rule, a window drawn atx + Pthat the user drags to the left past the left edge of the strip growsPby the same amount, and its copy does not move: the window would stop under a moving pointer. - While a grab or an animation runs,
cxcan leaveN, but it stays inside plus or minusBOUND:Camera::at(canvas.rs:108) keeps its bound and gets no ring rule. The compositor shiftscxbefore it callsCamera::at, and it makes the frame shift only when the result stays inside plus or minusBOUND. In the usual case it does:Nstarts atL, and the shiftedcxis 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. WhenPgrows 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 withinP / 2ofcx. A change ofPduring the animation moves no point withk = 0, so the target stays. - The pan.
CanvasPankeeps its start camera, and each motion givesstart.panned(delta)and thennormal.Pdoes not shrink during a pan. A grow during a pan (a window opens) moves only copies withkother than 0. Super with the middle button, the two-finger scroll and the wheel follow the same rule, throughuser_camera. - The zoom. Super+scroll, the pinch, the zoom step and the reset zoom about
flat_pointof the pointer as in phase 1, thenring_updategrowsPat once whenVcgrew. A pinch never shrinksPuntil it ends. - The clamp.
Camera::clamped(canvas.rs:184) gets each counted rectangle and its copies atx - Pandx + 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 agentwindow_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 storesxandyas given, as today, also with a ring. With a ring, it refuses a move that would setRabove2 * BOUNDwith the existing refusal "Canvas position out of bounds" (canvas_mode.rs:959), so an agent move toxnear 65536 with a window far on the other side cannot turn the ring off. A move past the edge of the strip then growsPby the grow rule, so a move tomaxRight + 48puts the window to the right of the last window, not onto the first window. The view still takes every position moduloPthrough the copy choice. The confirmation incanvasMove(web-shell/core/smithay.js:1235) stays exact, and the core reads no ring field for it. Rejected: storingnormal(x). It breaks the grow rule, and it is circular, becausendepends onL, which depends on the movedx.canvas_fitandagent_window(canvas_mode.rs:740, 808) apply the camera frame rule and fit the nearest copy.agent_limitsdoes not change.canvas_arrange, the agentarrange_windows rowand 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 atminLeft.Pthen 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 inothers: 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 growsP.show_canvas_windowthen 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 thanRING_GAP, soPwould grow and the copy would move away at each motion. set_camera(camera setand the logincamera restore, canvas_mode.rs:695). The input bound stays plus or minus 65536; thencxtakesnormal(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_statedescription says: on a ring (canvasRings),xandxplus or minus the period are the same place on the screen; amovestoresxas 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, orRpasses2 * BOUNDthrough a user move, an open or a restore). No window rectangle changes. The camera shifts by a whole multiple ofPso that the window with the keyboard (else the counted window nearest the center of the view) hask = 0and 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 (Rover2 * 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.
PtakesR, andcxtakesnormal(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
Ngive the same view with the ring on and off, except for the copies. The order ofcanvas_restore,camera restoreandsyncCanvasWarpdoes 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.originisnofN. - Not inside the entries of
canvasWorkspaces:validStatechecks 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 insidecanvasWarp, for the same reason with the check of phase 1. validStaterefuses a capability that is not a boolean, more than 100 entries, aworkspacethat is not a safe integer of 1 or more, anoriginthat is not a safe integer within plus or minus2 * BOUND, and aperiodthat is not a safe integer from 1 to2 * BOUND.- Phase 3 runs the
validStateof the core on main before phase 3 against a snapshot withcanvasRingsand the capability, as phase 1 does forcanvasWarp.
Tests
Cargo, native/smithay/src/canvas.rs (pure functions of canvas::Ring):
normalgives a value inNforxacross plus or minus3 * P, is idempotent and keepsxmoduloP.Nstays inside plus or minusBOUNDforPup to2 * BOUND, andnisLin the usual case.R:span + RING_GAP; the minimum withw_maxand the margin at zoom 0.1, 1 and 2; one window; no ring over2 * 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 (
Lmoves) setsPtoRat once; a zoom out sets the minimum at once; an open, a restore and an agent move with a copy withkother than 0 in view movePtoRin 300 ms, and at once with no such copy in view or with reduced motion. Windows withk = 0keep their screen place; copies withkother than 0 move by the change. - Shrink: the swept-copy test for
kin {-1, +1} in the frame of the camera, including a copy that would cross the view whilePmoves. A close of a window that is off the screen movesPtoRin 300 ms. A close at the seam in view keepsP. 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 + Pto 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 + Pand atx - Plands 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 mostP / 2), andcanvas_on_screenis then true.- Fit, fit all, the settle and the clamp take the copy; an animation from the shifted camera ends at the target while
Pchanges. canvas_movethat would setRabove2 * BOUND(a window atx = -60000and a move tox = 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
Pgrows: the grabbed point stays under the pointer at the next motion. canvas_movetomaxRight + 48stores thatx, puts the window to the right of the last window and growsP; the held window, the bounds and the lock refusals stay. A row on the ring starts atminLeft.normalwith a window atx = -BOUND:nis-BOUND, andnormal(cx)stays inside plus or minusBOUND.- Unwrap: the ring off keeps every rectangle, and the keyboard window keeps its screen place; the ring on keeps
cxmoduloP. - Snapshot:
canvasRingskeys and bounds; the cameraxstays within plus or minus 65536 during a grab and an animation.
Node, web-shell/test:
validStateaccepts and refusescanvasRingsand 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
Pwith Super and the middle button and with scroll on empty canvas. Check instatethatcxstays inNand that the first window shows again. Capture at the seam: each window shows once. - Open a fourth window:
canvasRingsreports 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_movethrough the control socket of the nested session with anxpast the last window: the storedxis thatx, and the period grows at once. With one window atx = -60000, acanvas_moveof another window tox = 65536is refused with "Canvas position out of bounds", andcanvasWarp.drawnandcanvasRingsstay. - Open the F9 overview at the seam: the plane shows the copies. Turn the setting off: every rectangle in
statestays, 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
- Phase 0: this document. Rollback: revert the commit.
- 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 warpedhit_in, the press block of the button handler (withinput_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 useflat_point. Purpose: the user judges the look and the motion before the exact input. - 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. - Phase 3, the ring.
canvas::Ring(the period, the origin,normal, the copy choice, grow and shrink),Workspace.ring,ring_update, the copy incanvas_placementand in the direct projections, the camera frame rule, the modular rules of each command, the unwrap rule,canvasRingsandcapabilities.canvasRing, the core check ofvalidState, 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. - Phase 4, sphere. The second map, its
flat_overlaps, andspherein the setting. The ring stays horizontal. - 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
Gis 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_pointis 1:1 outside the viewport for a motion away from the edge. A motion along the edge goes throughGof 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 toG(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
sphereas an unknown mode. The core also refuses it in the setting and in--setting; a snapshot from a later compositor withspherepassesvalidState. - 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), sowindow_lensgives 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
canvasWarpthat 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
OutputDamageTrackerand 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_runshas 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; theegl_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), andwindow_lensgives 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) usecanvas_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
canvasWarpthat 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)) = sandG(W(p)) = pwithin 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. Gis the identity at the center, its Jacobian is the identity there, and no singular value of its Jacobian is above 1.flat_pointis continuous at the edge of the content area, moves 1:1 outside it, and is the identity whiledrawn()is false. A move grab that crosses to the second output keeps the grabbed point under the pointer.visible_flatfor each mode:Wof its four corners is inside the viewport, and the same rectangle 1 px larger is not.flat_overlapsagrees with a dense raster ofG(V)for each mode.- A GPU test (as
native_wgpu_depth_blurs_only_moving_cards_and_lands_pixel_sharpinwgpu_renderer_workspace_tests.rs; its GLES originalegl_depth_...in workspace_depth.rs was deleted 2026-11-11) draws a known pattern through the shader, reads it back, and compares sample pixels withGin Rust within 1 px. - A failed shader compile draws flat, sets
error, and keepsdrawn()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.rsandwindow_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 ofG. 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 forcanvas_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_plangives no plan whiledrawn()is true. - While locked,
canvas_warpwith modecylinderis accepted and with modeoffis refused; an unknown mode or angle is refused; modeoffdisables 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:
validStateaccepts the new fields and refuses each bad value above;syncCanvasWarpsends 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|spheretoscripts/nested-qa.py(when this was written it accepted onlyworkspaceOutputsandcanvas; since 2026-11-03 it acceptscanvasandcanvasWarp). - 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_timingduring 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 instatethat the camera followsG. - 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.
- Cylinder or sphere: the cylinder first (phase 1), the sphere in phase 4 with the same pipeline.
- 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
Pthat the windows set; the lens stays a screen-space lens, so the curvature and the window size do not change withP;Pis the extent of the windows plus the gaps, with a minimum of the visible width plus a margin;Pgrows (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 atxorx ± P, and the input uses the same rule; every position rule takes the position moduloP; 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
Nthat starts near the first window, not in[0, P), because the windows keep their stored coordinates.
- The strength of the curvature: a 60 degree view by default, adjustable from 20 to 90 degrees.
- 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.
- The F9 overview, its planes and the workspace transitions stay flat. The lens turns off for their duration and on at their end.
- The primary output only. A Canvas workspace on an extra output stays flat, with no ring.
- While the warp draws, every screen capture saves the warped image, and the screenshot UI hides "Resolução original".