Repository navigation
refactor: group Smallvil state into substates (plan step 8, 0.90.210–0.90.211) - #15
Merged
Merged
Conversation
Plan step 8a, approved by Fiw. The four IPC subscriber fields move out of Smallvil into state::ipc::IpcState, reached as self.ipc: ipc_subscribers -> ipc.subscribers ipc_seen -> ipc.seen (was private; now pub(super)) ipc_flush_token -> ipc.flush_token next_ipc_subscriber_id -> ipc.next_subscriber_id Field docs move verbatim; 24 use sites are rewritten to the new paths and nothing else in their bodies changes. Two doc comments that named the old fields now name the new ones. No accessors, no behavior change. 712 tests, fmt and strict Clippy pass.
Plan step 8b, approved by Fiw. Thirteen render-only motion fields move out of Smallvil into state::physics::FloatPhysicsState, reached as self.physics, with their names, types, visibility and docs unchanged: window_viscosity, window_sway, window_float_physics, window_float_ambient, window_float_bodies, float_physics_accum, float_physics_last_tick, float_physics_wave_clock, window_currents, window_buoyancy, buoyancy_dirty, buoyancy_camera_revision, buoyancy_camera_was_moving. floating_dragging stays: it is grab state. 111 use sites gain the `.physics` step and nothing else; rustfmt rewraps the chains that grew. Initializers move into one nested literal with the same values. No accessors, no behavior change. 712 tests, fmt and strict Clippy pass.
Plan step 8c, approved by Fiw. Eleven workspace-owned fields leave Smallvil for state::workspace::WorkspaceState, reached as self.spatial.workspaces, with names, types and docs unchanged: layout, floating_workspace, pinned, pseudo_tiled, scratchpad_previous, scratchpad_named, workspace_previous, workspace_step_output, workspace_created_empty_fired, output_pins and classic_depth. `ocean` moves to self.spatial.ocean. SpatialState now holds the running engine and both ownership models it selects between. 594 workspace and 194 Ocean use sites gain the path step and nothing else; rustfmt rewraps the longer chains. A whitespace/brace-normalized comparison against the parent shows no other change outside the three structural files. Receivers were limited to self/state/data so same-named fields (reef.layout, config.ocean, config.classic_depth, the XKB layout in virtual_keyboard) are untouched. SpatialState drops its Copy/Clone/Debug derive and hit_tests_through_space takes &self. SpatialState, WorkspaceState and the moved fields stay `pub`, as layout and ocean were on Smallvil; narrowing them would expose test-only Layouts/OceanSpace methods to the dead-code lint, which is a separate cleanup. Initializers nest inside the spatial literal with the same values. No accessors, no behavior change. 712 tests, fmt and strict Clippy (all and default features) pass.
Plan step 8e, approved by Fiw (focus fields included). Twenty-eight fields leave Smallvil for state::focus::InputState, reached as self.input, with names, types, visibility and docs unchanged: focus authority (window_focus, on_demand_layer_focus, keyboard_focus, focus_history, cycling_focus, popup_grab), key and bind state (active_mode, rescue_keybinds_active, helper_keys_down, keyboard_layout_state, virtual_keyboard_keymap, configured_keymap, minimap_trigger_down), pointer grabs and gestures (compositor_gesture, suppressed_pointer_buttons, classic_tile_drag, floating_dragging, scroll_pointer_refresh_pending, last_pointer_motion, cursor_idle_timer_armed, last_activity), cursor (cursor_status, dnd_icon, cursor_theme) and devices (known_input_devices, input_device_outputs, is_lid_closed, is_tablet_mode). `seat` and the protocol globals stay on Smallvil. 187 use sites gain the `.input` step and nothing else; a normalized comparison shows no other change outside mod.rs, init.rs and focus.rs. reconcile_keyboard_focus remains the only writer of seat focus. No accessors, no behavior change. 712 tests, fmt and strict Clippy (all and default features) pass.
Plan step 8d (1/3), approved by Fiw with nested render groups. Adds state::render::RenderState, reached as self.render, and moves twenty-two fields into its `gpu` member (RenderGpuState) with names, types, visibility and docs unchanged: the twelve built-in shader programs, the custom-shader cache (custom_shader_programs, custom_shader_compile_budget, custom_shader_instances, custom_shader_bypassed, custom_shader_bypasses) and the per-surface GPU resources (backdrop_textures, layer_alpha_masks, layer_dim_buffers, window_frame_snapshots, depth_schematics). This is the group Ebb's accounting attaches to. 108 use sites gain the `.render.gpu` step and nothing else; a normalized comparison shows no other change outside mod.rs, init.rs and render.rs. No accessors, no behavior change. 712 tests, fmt and strict Clippy (all and default features) pass.
Plan step 8d (2/3). Seven fields leave Smallvil for the `windows` member of RenderState (RenderWindowsState), reached as self.render.windows, with names, types, visibility and docs unchanged: window_opacity, window_glass_modes, window_shader_assignments, layer_shader_assignments, glass_anim, window_depths and depth_last_tick. 62 use sites gain the `.render.windows` step and nothing else; a normalized comparison shows no other change outside mod.rs, init.rs and render.rs. No accessors, no behavior change. 712 tests, fmt and strict Clippy (all and default features) pass.
…tion Plan step 8d (3/3). Twenty-one fields leave Smallvil for the `motion` member of RenderState (RenderMotionState), reached as self.render.motion, with names, types, visibility and docs unchanged: ripples, the open/cascade/move/closing window animations, the pending and active workspace transitions, workspace_glides, depth_transitions, swim_cameras, workspace_scroll_cameras, the per-output ocean_canvases, caustics and compasses, the depth background and its timer/deadline, snap_preview, and the redraw_requests/redraw_wakeup/native_render_stats scheduling state. 185 use sites gain the `.render.motion` step and nothing else; the receiver filter leaves config.caustics alone, and a normalized comparison shows no other change outside mod.rs, init.rs and render.rs. No accessors, no behavior change. 712 tests, fmt and strict Clippy (all and default features) pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plan step 8: the compositor's main state struct,
Smallvil, goes from 226 flat fields to 119 by grouping related fields into named substates. Field lists approved by Fiw. Pure path moves: no behavior change, no accessors or forwarding methods, field names/types/docs unchanged.7fec946(8a)IpcStateself.ipc8c04c3f(8b)FloatPhysicsStateself.physics9282d85(8c)WorkspaceState+ Ocean insideSpatialStateself.spatial.workspaces,self.spatial.oceancfb7193(8e)InputState(focus included)self.inputd94e90a(8d 1/3)RenderState::gpu(shader programs, GPU textures; Ebb attaches here)self.render.gpu45636bd(8d 2/3)RenderState::windows(per-window render settings)self.render.windowsf400c55(8d 3/3)RenderState::motion(animations, cameras, redraw)self.render.motionPlus
2b0e295(0.90.210) and361d60a(0.90.211): version bumps and both changelogs.Deliberately left on
Smallvil: compositor UI fields (a laterUiState),seat, the protocol globals, and engine-neutral overlays (fullscreen,maximized,groups).Visibility:
SpatialState,WorkspaceStateand the movedlayout/oceanfields staypub, as onSmallvil. Narrowing them would expose test-only methods (Layouts::ratio_at, threeOceanSpacemethods,rectangle_gap_distance) to the dead-code lint; that cleanup is tracked separately.SpatialStatedrops itsCopy/Clone/Debugderive andhit_tests_through_spacetakes&self.Verification:
self/state/datareceivers; the three XKBstate.layoutsites invirtual_keyboard.rswere restored by hand..209and.210; subscriber checks pass in Classic, Scroll and Ocean..211:tidectl doctor10/10, startup probe passes with user state unchanged, and 12 WM + 4 client fullscreen round trips across Scroll→Classic→Scroll with state restored.