diff --git a/openspec/changes/archive/2026-03-19-rename-compositor-namespace/design.md b/openspec/changes/archive/2026-03-19-rename-compositor-namespace/design.md new file mode 100644 index 00000000..a9b001e8 --- /dev/null +++ b/openspec/changes/archive/2026-03-19-rename-compositor-namespace/design.md @@ -0,0 +1,114 @@ +# Design: Rename compositor namespace from goggles::input to goggles::compositor + +## Technical Approach + +This is a mechanical find-and-replace rename executed as a single atomic commit. Every occurrence of `namespace goggles::input` and every qualified `goggles::input::` reference is replaced with `goggles::compositor`. No phased rollout, no compatibility shims, no intermediate states. + +The change touches three categories of files: + +1. **Compositor source** (14 files): Replace `namespace goggles::input` declarations in all headers and implementation files under `src/compositor/`. +2. **UI forward declaration** (1 file): Update the forward declaration of `SurfaceInfo` in `src/ui/imgui_layer.hpp`. +3. **Test references** (3 files): Update qualified `goggles::input::` references in `tests/input/` and `tests/render/`. + +Total: 18 files modified, 0 files created or deleted. + +## Architecture Decisions + +### Decision: Single atomic commit + +**Choice**: Apply all 18 file changes in one commit. +**Alternatives considered**: Incremental migration with a namespace alias bridging old and new names across multiple commits. +**Rationale**: The rename is purely mechanical with no external consumers or ABI boundary. A single commit eliminates any intermediate state where both namespaces coexist. If the build breaks, the failure is a hard compile error (the old namespace ceases to exist), making missed references trivially detectable. Rollback is a single `git revert`. + +### Decision: Type names unchanged + +**Choice**: Keep all type names as-is (e.g., `InputEventType`, `CompositorServer`). +**Alternatives considered**: Rename types that contain "input" to use "compositor" for consistency. +**Rationale**: Type names like `InputEventType` are semantic names describing what they represent (input events), not artifacts of the namespace they happen to live in. Renaming them would be a separate semantic change with its own scope and risk, not part of a namespace alignment fix. + +### Decision: Archived openspec documents not updated + +**Choice**: Do not modify any existing openspec documents that reference `goggles::input`. +**Alternatives considered**: Update all historical references across the repository. +**Rationale**: Archived design documents are historical records. Retroactively editing them misrepresents what was designed at the time. The rename is self-documenting through this change's own openspec artifacts and the git history. + +## Affected Components + +### Compositor source files (14 files) + +All files under `src/compositor/` that declare `namespace goggles::input`: + +| File | Type | +|------|------| +| `src/compositor/compositor_server.hpp` | Public header | +| `src/compositor/compositor_server.cpp` | Implementation | +| `src/compositor/compositor_state.hpp` | Internal header | +| `src/compositor/compositor_protocol_hooks.hpp` | Internal header | +| `src/compositor/compositor_targets.hpp` | Internal header | +| `src/compositor/compositor_runtime_metrics.hpp` | Internal header | +| `src/compositor/compositor_core.cpp` | Implementation | +| `src/compositor/compositor_cursor.cpp` | Implementation | +| `src/compositor/compositor_input.cpp` | Implementation | +| `src/compositor/compositor_focus.cpp` | Implementation | +| `src/compositor/compositor_layer_shell.cpp` | Implementation | +| `src/compositor/compositor_present.cpp` | Implementation | +| `src/compositor/compositor_xdg.cpp` | Implementation | +| `src/compositor/compositor_xwayland.cpp` | Implementation | + +### UI forward declaration (1 file) + +| File | Change | +|------|--------| +| `src/ui/imgui_layer.hpp` | `namespace goggles::input { struct SurfaceInfo; }` becomes `namespace goggles::compositor { struct SurfaceInfo; }` | + +### Test references (3 files) + +| File | Symbols referenced | +|------|-------------------| +| `tests/input/auto_input_forwarding_wayland.cpp` | `goggles::input::CompositorServer::create()` | +| `tests/input/auto_input_forwarding_x11.cpp` | `goggles::input::CompositorServer::create()` | +| `tests/render/test_filter_boundary_contracts.cpp` | `goggles::input::wlr_surface*`, `goggles::input::RuntimeMetricsState` | + +### Unaffected areas + +| Area | Why unaffected | +|------|---------------| +| `filter-chain/` | Zero references to `goggles::input` anywhere in the submodule | +| CMake build files | No namespace-dependent configuration exists | +| `shaders/retroarch/` | Read-only upstream mirror, no C++ references | +| `research/` | Read-only reference material | + +## Data Flow + +No data flow changes. The rename is purely syntactic. All runtime behavior, call graphs, data ownership, threading model, and module boundaries remain identical. The compiled binary is semantically equivalent (only symbol mangling changes, which is irrelevant since there is no binary distribution or ABI stability contract). + +## Interfaces / Contracts + +No interface or contract changes. Every public and internal API retains its signature, semantics, and behavior. The only difference is the enclosing namespace identifier in declarations and qualified references. + +## Testing Strategy + +| Layer | What to Test | Approach | +|-------|--------------|----------| +| Compilation | All 18 modified files compile | `pixi run build -p debug` confirms no remaining `goggles::input` references cause errors | +| Unit + integration tests | All existing tests pass | `pixi run test -p test` exercises the full test suite including the 3 modified test files | +| Full CI | Format, ASAN, clang-tidy, consumer validation, semgrep | `pixi run ci --runner container --cache-mode warm --lane all` is the single acceptance gate | + +No new tests are needed. The rename does not introduce new behavior to verify. The existing test suite provides complete coverage of the renamed namespace through the 3 test files that reference compositor types. + +## Verification Strategy + +1. `pixi run format` — ensure clang-format compliance after edits. +2. `pixi run ci --runner container --cache-mode warm --lane all` — full CI pipeline as the sole acceptance gate per project policy (ALWAYS rule I2/I7). + +A green full-CI run is the only accepted verification. Partial commands are useful during development but do not substitute for the final gate. + +## Migration / Rollout + +Not applicable. This is a single atomic commit with no migration path, no compatibility period, and no phased rollout. The old namespace ceases to exist the moment the commit lands. + +**Rollback**: `git revert ` restores `goggles::input` everywhere. + +## Open Questions + +None. All decisions are resolved in the proposal. The rename is fully mechanical with no ambiguity. diff --git a/openspec/changes/archive/2026-03-19-rename-compositor-namespace/proposal.md b/openspec/changes/archive/2026-03-19-rename-compositor-namespace/proposal.md new file mode 100644 index 00000000..06b305c8 --- /dev/null +++ b/openspec/changes/archive/2026-03-19-rename-compositor-namespace/proposal.md @@ -0,0 +1,133 @@ +# Proposal: Rename compositor namespace from goggles::input to goggles::compositor + +## Problem + +The compositor module (`src/compositor/`) uses `goggles::input` as its C++ namespace. Every other module follows the project convention that namespace matches directory name (`app` → `goggles::app`, `render` → `goggles::render`, `ui` → `goggles::ui`, `util` → `goggles::util`). The compositor is the sole exception, affecting 14 source files internally and 4 files externally. This violates the ALWAYS rule "Follow namespace convention: `goggles::{module_name}`" (PROJECT_RULES.md, I3) and was confirmed as a historical anomaly in RFC.md (I5, Q1 — resolved: rename). + +## Intent + +Rename the `goggles::input` namespace to `goggles::compositor` so the project-wide namespace convention holds uniformly with zero exceptions. + +## Scope + +### In Scope + +- Rename all `namespace goggles::input` declarations in `src/compositor/` to `namespace goggles::compositor`. +- Update all qualified references (`goggles::input::*`) in consuming modules and tests. +- Update the forward declaration in `src/ui/imgui_layer.hpp`. +- Run `pixi run format` after changes. +- Verify with `pixi run ci --runner container --cache-mode warm --lane all`. + +### Out of Scope + +- Renaming or reorganizing the `src/compositor/` directory structure. +- Changing any type names, function signatures, or class APIs within the compositor module. +- Modifying the filter-chain submodule (confirmed: zero references to `goggles::input`). +- Updating archived openspec documents (historical records remain as-is). +- Any functional or behavioral changes to the compositor. + +## Approach + +This is a single-phase mechanical rename. No architectural changes, no phased rollout. + +### Step 1: Namespace declarations (14 files) + +Replace `namespace goggles::input` with `namespace goggles::compositor` in all compositor module files: + +| File | Type | +|------|------| +| `src/compositor/compositor_server.hpp` | Public header | +| `src/compositor/compositor_server.cpp` | Implementation | +| `src/compositor/compositor_state.hpp` | Internal header | +| `src/compositor/compositor_protocol_hooks.hpp` | Internal header | +| `src/compositor/compositor_targets.hpp` | Internal header | +| `src/compositor/compositor_runtime_metrics.hpp` | Internal header | +| `src/compositor/compositor_core.cpp` | Implementation | +| `src/compositor/compositor_cursor.cpp` | Implementation | +| `src/compositor/compositor_input.cpp` | Implementation | +| `src/compositor/compositor_focus.cpp` | Implementation | +| `src/compositor/compositor_layer_shell.cpp` | Implementation | +| `src/compositor/compositor_present.cpp` | Implementation | +| `src/compositor/compositor_xdg.cpp` | Implementation | +| `src/compositor/compositor_xwayland.cpp` | Implementation | + +### Step 2: Forward declaration (1 file) + +Update `src/ui/imgui_layer.hpp`: +- `namespace goggles::input { struct SurfaceInfo; }` → `namespace goggles::compositor { struct SurfaceInfo; }` + +### Step 3: Qualified references in tests (3 files) + +Update all `goggles::input::` qualifications: + +| File | Symbols referenced | +|------|-------------------| +| `tests/input/auto_input_forwarding_wayland.cpp` | `goggles::input::CompositorServer::create()` | +| `tests/input/auto_input_forwarding_x11.cpp` | `goggles::input::CompositorServer::create()` | +| `tests/render/test_filter_boundary_contracts.cpp` | `goggles::input::wlr_surface*`, `goggles::input::RuntimeMetricsState` | + +### Step 4: Format and verify + +1. `pixi run format` +2. `pixi run ci --runner container --cache-mode warm --lane all` + +## Affected Areas + +| Area | Impact | Description | +|------|--------|-------------| +| `src/compositor/*.hpp` | Modified | Namespace declaration changed in 6 headers | +| `src/compositor/*.cpp` | Modified | Namespace declaration changed in 8 implementation files | +| `src/ui/imgui_layer.hpp` | Modified | Forward declaration updated | +| `tests/input/auto_input_forwarding_*.cpp` | Modified | Qualified name references updated (2 files) | +| `tests/render/test_filter_boundary_contracts.cpp` | Modified | Qualified name references updated | +| `filter-chain/` | None | Zero references to `goggles::input` — no changes needed | +| CMake build files | None | No namespace-dependent configuration exists | + +**Total: 18 files modified, 0 files created or deleted.** + +## Non-goals + +- Introduce a new `compositor` sub-namespace hierarchy or reorganize types within the module. +- Rename or split any types (e.g., keeping `InputEventType` as-is — the type name is semantic, not a namespace artifact). +- Update archived design documents that reference the old namespace. + +## Risks + +| Risk | Likelihood | Mitigation | +|------|------------|------------| +| Missed reference causes build failure | Low | Full CI gate catches all compile errors; `goggles::input` does not exist after rename, so any remaining reference is a hard compile error | +| Symbol mangling change breaks something | None | Monolithic build; no binary distribution or ABI stability contract | +| Name collision with existing `goggles::compositor` | None | Confirmed: `goggles::compositor` does not exist anywhere in the codebase | + +## Rollback Plan + +Single commit. Revert the commit to restore `goggles::input` everywhere. + +## Dependencies + +None. No external consumers, no ABI boundary, no submodule impact. + +## Validation Plan + +- `pixi run build -p debug` — confirms compilation after rename. +- `pixi run test -p test` — confirms all tests pass with new namespace. +- `pixi run ci --runner container --cache-mode warm --lane all` — full CI gate (ALWAYS rule, I2/I7). + +## Success Criteria + +- [ ] Zero occurrences of `goggles::input` in `src/` and `tests/` (excluding archived docs). +- [ ] All compositor module files use `namespace goggles::compositor`. +- [ ] The forward declaration in `src/ui/imgui_layer.hpp` references `goggles::compositor`. +- [ ] Full CI passes: `pixi run ci --runner container --cache-mode warm --lane all`. +- [ ] The ALWAYS rule "Follow namespace convention: `goggles::{module_name}`" applies uniformly with no exceptions. + +## PROJECT_RULES.md Compliance + +| Rule | Status | +|------|--------| +| ALWAYS: Follow namespace convention `goggles::{module_name}` (I3) | This change enforces it | +| ALWAYS: Run `pixi run format` before committing (I7) | Step 4 | +| ALWAYS: Use `pixi run ci ...` for final verification (I2, I7) | Step 4 | +| NEVER: Create circular module dependencies (I8) | No dependency changes | +| NEVER: Modify files in `shaders/retroarch/` or `research/` (I3) | Not touched | +| ASK FIRST: Modifying filter-chain library boundary (I4) | Not touched — confirmed zero impact | diff --git a/openspec/changes/archive/2026-03-19-rename-compositor-namespace/spec.md b/openspec/changes/archive/2026-03-19-rename-compositor-namespace/spec.md new file mode 100644 index 00000000..93c5bc69 --- /dev/null +++ b/openspec/changes/archive/2026-03-19-rename-compositor-namespace/spec.md @@ -0,0 +1,143 @@ +# Spec: Rename compositor namespace from goggles::input to goggles::compositor + +**Change:** rename-compositor-namespace +**Proposal:** [proposal.md](proposal.md) + +--- + +## Requirement: Namespace Declaration Convention + +All source files in the `src/compositor/` directory SHALL declare their namespace as `namespace goggles::compositor`. No file in the compositor module SHALL use `namespace goggles::input` or any other namespace that does not match the directory name. + +### Scenario: Compositor headers use correct namespace + +- **GIVEN** the compositor public and internal headers: + - `src/compositor/compositor_server.hpp` + - `src/compositor/compositor_state.hpp` + - `src/compositor/compositor_protocol_hooks.hpp` + - `src/compositor/compositor_targets.hpp` + - `src/compositor/compositor_runtime_metrics.hpp` +- **WHEN** namespace declarations in each file are inspected +- **THEN** every namespace declaration SHALL be `namespace goggles::compositor` +- **AND** zero occurrences of `namespace goggles::input` SHALL exist + +### Scenario: Compositor implementation files use correct namespace + +- **GIVEN** the compositor implementation files: + - `src/compositor/compositor_server.cpp` + - `src/compositor/compositor_core.cpp` + - `src/compositor/compositor_cursor.cpp` + - `src/compositor/compositor_input.cpp` + - `src/compositor/compositor_focus.cpp` + - `src/compositor/compositor_layer_shell.cpp` + - `src/compositor/compositor_present.cpp` + - `src/compositor/compositor_xdg.cpp` + - `src/compositor/compositor_xwayland.cpp` +- **WHEN** namespace declarations in each file are inspected +- **THEN** every namespace declaration SHALL be `namespace goggles::compositor` +- **AND** zero occurrences of `namespace goggles::input` SHALL exist + +--- + +## Requirement: No Residual References to Old Namespace + +After the rename, zero occurrences of the string `goggles::input` SHALL exist anywhere in `src/` or `tests/`. This ensures no stale qualified references, using-declarations, or comments referencing the old namespace survive the rename. + +### Scenario: Source tree contains no old namespace references + +- **GIVEN** the directories `src/` and `tests/` +- **WHEN** a text search for the literal string `goggles::input` is executed across all files +- **THEN** zero matches SHALL be found + +### Scenario: No residual using-declarations reference old namespace + +- **GIVEN** the directories `src/` and `tests/` +- **WHEN** a text search for `using namespace goggles::input` or `namespace input = goggles::input` is executed +- **THEN** zero matches SHALL be found + +--- + +## Requirement: Forward Declaration Consistency + +The forward declaration of compositor types in consumer modules SHALL reference the `goggles::compositor` namespace, not `goggles::input`. + +### Scenario: ImGui layer forward declaration updated + +- **GIVEN** the file `src/ui/imgui_layer.hpp` +- **WHEN** forward declarations of compositor types are inspected +- **THEN** the forward declaration of `SurfaceInfo` SHALL appear within `namespace goggles::compositor` +- **AND** zero occurrences of `namespace goggles::input` SHALL exist in the file + +--- + +## Requirement: Qualified Reference Consistency in Tests + +All test files that reference compositor types via fully qualified names SHALL use the `goggles::compositor::` prefix. + +### Scenario: Input forwarding test files use new namespace + +- **GIVEN** the test files: + - `tests/input/auto_input_forwarding_wayland.cpp` + - `tests/input/auto_input_forwarding_x11.cpp` +- **WHEN** qualified references to `CompositorServer::create()` are inspected +- **THEN** every reference SHALL use `goggles::compositor::CompositorServer::create()` +- **AND** zero occurrences of `goggles::input::CompositorServer` SHALL exist + +### Scenario: Filter boundary contract tests use new namespace + +- **GIVEN** the file `tests/render/test_filter_boundary_contracts.cpp` +- **WHEN** qualified references to compositor types are inspected +- **THEN** references to `wlr_surface` and `RuntimeMetricsState` SHALL use the `goggles::compositor::` prefix +- **AND** zero occurrences of `goggles::input::` SHALL exist in the file + +--- + +## Requirement: Build Verification + +The project SHALL compile cleanly and pass all tests after the namespace rename. Because the old namespace `goggles::input` ceases to exist, any missed reference will produce a hard compile error — there is no risk of a silent partial rename. + +### Scenario: Debug build succeeds + +- **GIVEN** all namespace changes are applied +- **WHEN** `pixi run build -p debug` is executed +- **THEN** the build SHALL succeed with zero errors + +### Scenario: Full test suite passes + +- **GIVEN** all namespace changes are applied +- **WHEN** `pixi run test -p test` is executed +- **THEN** all tests SHALL pass + +### Scenario: Full CI pipeline passes + +- **GIVEN** all namespace changes are applied and formatted via `pixi run format` +- **WHEN** `pixi run ci --runner container --cache-mode warm --lane all` is executed +- **THEN** all CI lanes SHALL pass (format, build+test with ASAN, package install + consumer validation, semgrep, clang-tidy quality gate) + +--- + +## Requirement: No Functional Changes + +The rename SHALL be a purely mechanical transformation. No type names, function signatures, class APIs, or runtime behavior SHALL change. Only the enclosing namespace identifier changes from `input` to `compositor`. + +### Scenario: Type names are preserved + +- **GIVEN** the compositor module types: `CompositorServer`, `CompositorState`, `SurfaceInfo`, `RuntimeMetricsState`, and all other public and internal types +- **WHEN** their declarations are inspected after the rename +- **THEN** every type name SHALL be identical to its pre-rename name +- **AND** only the enclosing namespace SHALL differ + +### Scenario: Function signatures are preserved + +- **GIVEN** all public and internal function signatures in the compositor module +- **WHEN** they are inspected after the rename +- **THEN** every function name, parameter list, and return type SHALL be identical to pre-rename +- **AND** no function SHALL be added, removed, or modified + +### Scenario: No files created or deleted + +- **GIVEN** the set of files modified by this change +- **WHEN** the changeset is inspected +- **THEN** zero files SHALL be created +- **AND** zero files SHALL be deleted +- **AND** exactly 18 files SHALL be modified (14 compositor module files, 1 UI forward declaration, 3 test files) diff --git a/openspec/changes/archive/2026-03-19-rename-compositor-namespace/tasks.md b/openspec/changes/archive/2026-03-19-rename-compositor-namespace/tasks.md new file mode 100644 index 00000000..bcf2f0de --- /dev/null +++ b/openspec/changes/archive/2026-03-19-rename-compositor-namespace/tasks.md @@ -0,0 +1,36 @@ +# Tasks: Rename compositor namespace from goggles::input to goggles::compositor + +- [x] T1 Rename namespace declarations in all compositor module files + - Description: Replace every `namespace goggles::input` declaration with `namespace goggles::compositor` across all 14 source files in `src/compositor/`. This covers both the opening declaration and any closing comment annotations. No type names, function signatures, or class APIs change. + - Files involved: `src/compositor/compositor_server.hpp`, `src/compositor/compositor_server.cpp`, `src/compositor/compositor_state.hpp`, `src/compositor/compositor_protocol_hooks.hpp`, `src/compositor/compositor_targets.hpp`, `src/compositor/compositor_runtime_metrics.hpp`, `src/compositor/compositor_core.cpp`, `src/compositor/compositor_cursor.cpp`, `src/compositor/compositor_input.cpp`, `src/compositor/compositor_focus.cpp`, `src/compositor/compositor_layer_shell.cpp`, `src/compositor/compositor_present.cpp`, `src/compositor/compositor_xdg.cpp`, `src/compositor/compositor_xwayland.cpp` + - Verification method: `rg -n "goggles::input" src/compositor/` returns zero matches; `pixi run build -p debug` succeeds + - Dependencies: None + - Estimated complexity: S + +- [x] T2 Update forward declaration in UI module + - Description: Update the forward declaration `namespace goggles::input { struct SurfaceInfo; }` to `namespace goggles::compositor { struct SurfaceInfo; }` in the UI module header. + - Files involved: `src/ui/imgui_layer.hpp` + - Verification method: `rg -n "goggles::input" src/ui/` returns zero matches + - Dependencies: T1 + - Estimated complexity: S + +- [x] T3 Update qualified references in test files + - Description: Replace all `goggles::input::` qualified references with `goggles::compositor::` in the three test files that consume compositor types. This includes `goggles::input::CompositorServer::create()` in both input-forwarding tests and `goggles::input::wlr_surface*` / `goggles::input::RuntimeMetricsState` in the filter boundary contracts test. + - Files involved: `tests/input/auto_input_forwarding_wayland.cpp`, `tests/input/auto_input_forwarding_x11.cpp`, `tests/render/test_filter_boundary_contracts.cpp` + - Verification method: `rg -n "goggles::input" tests/` returns zero matches; `pixi run build -p debug` succeeds + - Dependencies: T1 + - Estimated complexity: S + +- [x] T4 Format and full CI verification + - Description: Run the formatter to normalize any style drift introduced by the rename, then run the full CI pipeline to confirm the entire codebase compiles, links, passes all tests, and satisfies static analysis with the new namespace. + - Files involved: CI output only + - Verification method: `pixi run format`; `pixi run ci --runner container --cache-mode warm --lane all` exits with code 0 + - Dependencies: T1, T2, T3 + - Estimated complexity: S + +- [x] T5 Final grep sweep + - Description: Confirm zero occurrences of the old namespace remain anywhere in the source and test trees. This is the terminal acceptance gate for the rename. + - Files involved: `src/`, `tests/` + - Verification method: `rg -n "goggles::input" src/ tests/` returns empty output (no matches) + - Dependencies: T4 + - Estimated complexity: S diff --git a/src/app/application.cpp b/src/app/application.cpp index 57ae94f5..ac8b6bed 100644 --- a/src/app/application.cpp +++ b/src/app/application.cpp @@ -183,7 +183,7 @@ auto Application::init_compositor_server(const util::AppDirs& app_dirs) -> Resul if (!cursor_env_result) { GOGGLES_LOG_WARN("Cursor theme setup failed: {}", cursor_env_result.error().message); } - m_compositor_server = GOGGLES_MUST(input::CompositorServer::create()); + m_compositor_server = GOGGLES_MUST(compositor::CompositorServer::create()); GOGGLES_LOG_INFO("Compositor server: DISPLAY={} WAYLAND_DISPLAY={}", m_compositor_server->x11_display(), m_compositor_server->wayland_display()); set_target_fps(m_target_fps); @@ -206,7 +206,7 @@ auto Application::init_compositor_server_headless(const util::AppDirs& app_dirs) if (!cursor_env_result) { GOGGLES_LOG_WARN("Cursor theme setup failed: {}", cursor_env_result.error().message); } - m_compositor_server = GOGGLES_MUST(input::CompositorServer::create()); + m_compositor_server = GOGGLES_MUST(compositor::CompositorServer::create()); GOGGLES_LOG_INFO("Compositor server (headless): DISPLAY={} WAYLAND_DISPLAY={}", m_compositor_server->x11_display(), m_compositor_server->wayland_display()); set_target_fps(m_target_fps); @@ -494,7 +494,7 @@ void Application::sync_prechain_ui() { } } -void Application::sync_surface_filters(std::vector& surfaces) { +void Application::sync_surface_filters(std::vector& surfaces) { std::unordered_set seen; seen.reserve(surfaces.size()); @@ -625,7 +625,7 @@ void Application::request_surface_resize(uint32_t surface_id, bool maximize) { surface_state.resize = desired; surface_state.has_resize_state = true; - input::SurfaceResizeInfo resize{}; + compositor::SurfaceResizeInfo resize{}; resize.width = desired.width; resize.height = desired.height; resize.maximized = desired.maximized; @@ -633,7 +633,7 @@ void Application::request_surface_resize(uint32_t surface_id, bool maximize) { } void Application::update_surface_resize_for_surfaces( - const std::vector& surfaces) { + const std::vector& surfaces) { const bool global_enabled = compute_global_filter_chain_enabled(); for (const auto& surface : surfaces) { const bool surface_enabled = is_surface_filter_enabled(surface.id); diff --git a/src/app/application.hpp b/src/app/application.hpp index fa6e8196..28ac8f80 100644 --- a/src/app/application.hpp +++ b/src/app/application.hpp @@ -88,8 +88,8 @@ class Application { void update_cursor_visibility(); void update_mouse_grab(); void sync_prechain_ui(); - void sync_surface_filters(std::vector& surfaces); - void update_surface_resize_for_surfaces(const std::vector& surfaces); + void sync_surface_filters(std::vector& surfaces); + void update_surface_resize_for_surfaces(const std::vector& surfaces); [[nodiscard]] auto compute_global_filter_chain_enabled() const -> bool; [[nodiscard]] auto compute_surface_filter_chain_enabled(uint32_t surface_id) const -> bool; struct StagePolicy { @@ -105,7 +105,7 @@ class Application { bool m_sdl_initialized = false; std::unique_ptr m_vulkan_backend; std::unique_ptr m_imgui_layer; - std::unique_ptr m_compositor_server; + std::unique_ptr m_compositor_server; std::optional m_surface_frame; struct SurfaceResizeState { diff --git a/src/compositor/compositor_core.cpp b/src/compositor/compositor_core.cpp index 96f56d76..dd248f9f 100644 --- a/src/compositor/compositor_core.cpp +++ b/src/compositor/compositor_core.cpp @@ -35,7 +35,7 @@ extern "C" { #include #include -namespace goggles::input { +namespace goggles::compositor { namespace { @@ -401,4 +401,4 @@ void CompositorState::teardown() { wayland_socket_name.clear(); } -} // namespace goggles::input +} // namespace goggles::compositor diff --git a/src/compositor/compositor_cursor.cpp b/src/compositor/compositor_cursor.cpp index 425a3a15..692d8779 100644 --- a/src/compositor/compositor_cursor.cpp +++ b/src/compositor/compositor_cursor.cpp @@ -17,7 +17,7 @@ extern "C" { #include #include -namespace goggles::input { +namespace goggles::compositor { namespace { @@ -278,4 +278,4 @@ void CompositorState::render_cursor_overlay(wlr_render_pass* pass) const { wlr_render_pass_add_texture(pass, &options); } -} // namespace goggles::input +} // namespace goggles::compositor diff --git a/src/compositor/compositor_focus.cpp b/src/compositor/compositor_focus.cpp index 76d7074e..f0d80ace 100644 --- a/src/compositor/compositor_focus.cpp +++ b/src/compositor/compositor_focus.cpp @@ -40,7 +40,7 @@ extern "C" { #include #include -namespace goggles::input { +namespace goggles::compositor { namespace { @@ -1078,4 +1078,4 @@ auto CompositorState::get_surfaces_snapshot() const -> std::vector return result; } -} // namespace goggles::input +} // namespace goggles::compositor diff --git a/src/compositor/compositor_input.cpp b/src/compositor/compositor_input.cpp index bb28785b..c8828068 100644 --- a/src/compositor/compositor_input.cpp +++ b/src/compositor/compositor_input.cpp @@ -17,7 +17,7 @@ extern "C" { #include #include -namespace goggles::input { +namespace goggles::compositor { namespace { @@ -456,4 +456,4 @@ void CompositorState::handle_pointer_axis_event(const InputEvent& event, uint32_ wlr_seat_pointer_notify_frame(seat); } -} // namespace goggles::input +} // namespace goggles::compositor diff --git a/src/compositor/compositor_layer_shell.cpp b/src/compositor/compositor_layer_shell.cpp index ad0e0f7c..8abe253b 100644 --- a/src/compositor/compositor_layer_shell.cpp +++ b/src/compositor/compositor_layer_shell.cpp @@ -27,7 +27,7 @@ extern "C" { #include #include -namespace goggles::input { +namespace goggles::compositor { namespace { @@ -320,4 +320,4 @@ void CompositorState::render_layer_surfaces(wlr_render_pass* pass, uint32_t targ } } -} // namespace goggles::input +} // namespace goggles::compositor diff --git a/src/compositor/compositor_present.cpp b/src/compositor/compositor_present.cpp index 766894bf..d9123344 100644 --- a/src/compositor/compositor_present.cpp +++ b/src/compositor/compositor_present.cpp @@ -49,7 +49,7 @@ extern "C" { #include #include -namespace goggles::input { +namespace goggles::compositor { namespace { @@ -733,4 +733,4 @@ bool CompositorState::render_surface_to_frame(const InputTarget& target) { return true; } -} // namespace goggles::input +} // namespace goggles::compositor diff --git a/src/compositor/compositor_protocol_hooks.hpp b/src/compositor/compositor_protocol_hooks.hpp index e7ebe950..32b1294c 100644 --- a/src/compositor/compositor_protocol_hooks.hpp +++ b/src/compositor/compositor_protocol_hooks.hpp @@ -14,7 +14,7 @@ struct wlr_xwayland_surface; // NOLINTEND(readability-identifier-naming) } -namespace goggles::input { +namespace goggles::compositor { struct CompositorState; @@ -109,4 +109,4 @@ inline void detach_listener(wl_listener& listener) { wl_list_init(&listener.link); } -} // namespace goggles::input +} // namespace goggles::compositor diff --git a/src/compositor/compositor_runtime_metrics.hpp b/src/compositor/compositor_runtime_metrics.hpp index 1c737d4d..362756e9 100644 --- a/src/compositor/compositor_runtime_metrics.hpp +++ b/src/compositor/compositor_runtime_metrics.hpp @@ -11,7 +11,7 @@ struct wlr_surface; #include -namespace goggles::input { +namespace goggles::compositor { using ::wlr_surface; @@ -67,4 +67,4 @@ struct RuntimeMetricsState { } }; -} // namespace goggles::input +} // namespace goggles::compositor diff --git a/src/compositor/compositor_server.cpp b/src/compositor/compositor_server.cpp index 10122544..e456d17b 100644 --- a/src/compositor/compositor_server.cpp +++ b/src/compositor/compositor_server.cpp @@ -4,7 +4,7 @@ #include #include -namespace goggles::input { +namespace goggles::compositor { CompositorServer::CompositorServer() : m_impl(std::make_unique()) {} @@ -117,4 +117,4 @@ auto CompositorServer::get_runtime_metrics_snapshot() const return m_impl->state.get_runtime_metrics_snapshot(); } -} // namespace goggles::input +} // namespace goggles::compositor diff --git a/src/compositor/compositor_server.hpp b/src/compositor/compositor_server.hpp index 7567f9df..65a7c94f 100644 --- a/src/compositor/compositor_server.hpp +++ b/src/compositor/compositor_server.hpp @@ -10,7 +10,7 @@ #include #include -namespace goggles::input { +namespace goggles::compositor { /// @brief Identifies input events queued for dispatch on the compositor thread. enum class InputEventType : std::uint8_t { key, pointer_motion, pointer_button, pointer_axis }; @@ -121,4 +121,4 @@ class CompositorServer { std::unique_ptr m_impl; }; -} // namespace goggles::input +} // namespace goggles::compositor diff --git a/src/compositor/compositor_state.hpp b/src/compositor/compositor_state.hpp index 251aac70..d914d513 100644 --- a/src/compositor/compositor_state.hpp +++ b/src/compositor/compositor_state.hpp @@ -52,7 +52,7 @@ struct wlr_xwayland_surface; #include #include -namespace goggles::input { +namespace goggles::compositor { using ::wl_display; using ::wl_event_loop; @@ -293,4 +293,4 @@ struct CompositorServer::Impl { CompositorState state; }; -} // namespace goggles::input +} // namespace goggles::compositor diff --git a/src/compositor/compositor_targets.hpp b/src/compositor/compositor_targets.hpp index a8747a6f..410645a3 100644 --- a/src/compositor/compositor_targets.hpp +++ b/src/compositor/compositor_targets.hpp @@ -13,7 +13,7 @@ struct wlr_xwayland_surface; // NOLINTEND(readability-identifier-naming) } -namespace goggles::input { +namespace goggles::compositor { struct CompositorState; struct LayerSurfaceHooks; @@ -49,4 +49,4 @@ auto get_cursor_bounds(const CompositorState& state, const InputTarget& root_tar auto get_surface_local_coords(const CompositorState& state, const InputTarget& target) -> std::pair; -} // namespace goggles::input +} // namespace goggles::compositor diff --git a/src/compositor/compositor_xdg.cpp b/src/compositor/compositor_xdg.cpp index 58ef4e96..9480aebe 100644 --- a/src/compositor/compositor_xdg.cpp +++ b/src/compositor/compositor_xdg.cpp @@ -12,7 +12,7 @@ extern "C" { #include #include -namespace goggles::input { +namespace goggles::compositor { auto CompositorState::setup_xdg_shell() -> Result { GOGGLES_PROFILE_FUNCTION(); @@ -349,4 +349,4 @@ void CompositorState::handle_xdg_surface_destroy(XdgToplevelHooks* hooks) { } } -} // namespace goggles::input +} // namespace goggles::compositor diff --git a/src/compositor/compositor_xwayland.cpp b/src/compositor/compositor_xwayland.cpp index 94c9089c..d8b73b42 100644 --- a/src/compositor/compositor_xwayland.cpp +++ b/src/compositor/compositor_xwayland.cpp @@ -24,7 +24,7 @@ extern "C" { #include #include -namespace goggles::input { +namespace goggles::compositor { namespace { @@ -424,4 +424,4 @@ void CompositorState::handle_xwayland_surface_destroy(wlr_xwayland_surface* xsur auto_focus_next_surface(); } -} // namespace goggles::input +} // namespace goggles::compositor diff --git a/src/ui/imgui_layer.cpp b/src/ui/imgui_layer.cpp index ca34cd88..9c70f443 100644 --- a/src/ui/imgui_layer.cpp +++ b/src/ui/imgui_layer.cpp @@ -465,7 +465,7 @@ void ImGuiLayer::set_target_fps_change_callback(TargetFpsChangeCallback callback m_on_target_fps_change = std::move(callback); } -void ImGuiLayer::set_surfaces(std::vector surfaces) { +void ImGuiLayer::set_surfaces(std::vector surfaces) { m_surfaces = std::move(surfaces); } diff --git a/src/ui/imgui_layer.hpp b/src/ui/imgui_layer.hpp index be6fa31e..c15f8633 100644 --- a/src/ui/imgui_layer.hpp +++ b/src/ui/imgui_layer.hpp @@ -19,7 +19,7 @@ namespace goggles::util { struct AppDirs; } -namespace goggles::input { +namespace goggles::compositor { struct SurfaceInfo; } @@ -170,7 +170,7 @@ class ImGuiLayer { [[nodiscard]] auto is_globally_visible() const -> bool { return m_global_visible; } /// @brief Updates the displayed surface list. - void set_surfaces(std::vector surfaces); + void set_surfaces(std::vector surfaces); /// @brief Sets the callback invoked when a surface is selected. void set_surface_select_callback(SurfaceSelectCallback callback); /// @brief Sets the callback invoked when a surface filter toggle changes. @@ -217,7 +217,7 @@ class ImGuiLayer { SurfaceSelectCallback m_on_surface_select; SurfaceFilterToggleCallback m_on_surface_filter_toggle; TargetFpsChangeCallback m_on_target_fps_change; - std::vector m_surfaces; + std::vector m_surfaces; util::CompositorRuntimeMetricsSnapshot m_runtime_metrics; uint32_t m_target_fps = 60; uint32_t m_last_capped_target_fps = 60; diff --git a/tests/input/auto_input_forwarding_wayland.cpp b/tests/input/auto_input_forwarding_wayland.cpp index 309a1f55..59c74ed9 100644 --- a/tests/input/auto_input_forwarding_wayland.cpp +++ b/tests/input/auto_input_forwarding_wayland.cpp @@ -57,7 +57,7 @@ auto main() -> int { setenv("XDG_RUNTIME_DIR", runtime_dir.c_str(), 1); - auto compositor_result = goggles::input::CompositorServer::create(); + auto compositor_result = goggles::compositor::CompositorServer::create(); if (!compositor_result) { std::fprintf(stderr, "[FAIL] CompositorServer::create failed: %s\n", compositor_result.error().message.c_str()); diff --git a/tests/input/auto_input_forwarding_x11.cpp b/tests/input/auto_input_forwarding_x11.cpp index 7daaf046..64203996 100644 --- a/tests/input/auto_input_forwarding_x11.cpp +++ b/tests/input/auto_input_forwarding_x11.cpp @@ -63,7 +63,7 @@ auto main() -> int { setenv("XDG_RUNTIME_DIR", runtime_dir.c_str(), 1); - auto compositor_result = goggles::input::CompositorServer::create(); + auto compositor_result = goggles::compositor::CompositorServer::create(); if (!compositor_result) { std::fprintf(stderr, "[FAIL] CompositorServer::create failed: %s\n", compositor_result.error().message.c_str()); diff --git a/tests/render/test_filter_boundary_contracts.cpp b/tests/render/test_filter_boundary_contracts.cpp index 0fee5c9b..290790f9 100644 --- a/tests/render/test_filter_boundary_contracts.cpp +++ b/tests/render/test_filter_boundary_contracts.cpp @@ -58,9 +58,9 @@ auto collect_app_ui_sources() -> std::vector { return files; } -auto surface_token(std::uintptr_t value) -> goggles::input::wlr_surface* { +auto surface_token(std::uintptr_t value) -> goggles::compositor::wlr_surface* { // NOLINTNEXTLINE(performance-no-int-to-ptr) - return reinterpret_cast(value); + return reinterpret_cast(value); } } // namespace @@ -441,7 +441,7 @@ TEST_CASE("Filter chain standalone API boundary contract coverage", TEST_CASE("Runtime metrics keep root ownership while tracking the current capture surface", "[app_window][runtime_metrics_contract]") { - using RuntimeMetricsState = goggles::input::RuntimeMetricsState; + using RuntimeMetricsState = goggles::compositor::RuntimeMetricsState; RuntimeMetricsState metrics{}; auto* game_root = surface_token(0x1000);