Skip to content

Various refactorings#778

Merged
mahkoh merged 29 commits intomasterfrom
jorth/refactoring
Mar 7, 2026
Merged

Various refactorings#778
mahkoh merged 29 commits intomasterfrom
jorth/refactoring

Conversation

@mahkoh
Copy link
Owner

@mahkoh mahkoh commented Mar 7, 2026

Preliminary work for the control center

Copilot AI review requested due to automatic review settings March 7, 2026 14:07
github-actions[bot]
github-actions bot previously approved these changes Mar 7, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR performs extensive refactoring work as preliminary preparation for a control center feature. It centralizes state mutation methods, introduces new Wayland client-side protocol implementations, restructures logging, and adds various utility types.

Changes:

  • Centralizes UI-affecting state mutations (colors, sizes, fonts, workspace settings) into State methods, moving logic from config/handler.rs into state.rs
  • Adds numerous new usr_ifs (user-side interface) implementations for Wayland protocols (keyboard, data device, XDG shell, cursor shape, dmabuf) and refactors existing ones to use GlobalName, trait-based callbacks, and Rc<Self> receivers
  • Introduces LogLevel enum (replacing CliLogLevel), LazyEventSource/LazyEventSources, AtomicEnum, StaticText trait, Oklab/Oklch color spaces, and moves gpu_alloc_ash to vulkan_core

Reviewed changes

Copilot reviewed 92 out of 93 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/wl_usr/usr_ifs/usr_wl_keyboard.rs New keyboard handler with keymap parsing, key/modifier event handling
src/wl_usr/usr_ifs/usr_zwp_linux_buffer_params_v1.rs New dmabuf buffer params client-side implementation
src/wl_usr/usr_ifs/usr_zwp_linux_dmabuf_v1.rs New linux-dmabuf client-side implementation
src/wl_usr/usr_ifs/usr_xdg_*.rs New XDG shell client-side implementations (wm_base, surface, toplevel)
src/wl_usr/usr_ifs/usr_wp_cursor_shape_*.rs New cursor shape client-side implementations
src/wl_usr/usr_ifs/usr_wl_data_*.rs New data device/source/offer client-side implementations
src/wl_usr/usr_ifs/usr_wl_callback.rs Refactored to use trait-based owner pattern
src/wl_usr/usr_ifs/usr_wl_surface.rs frame() now returns the callback object
src/wl_usr/usr_ifs/usr_wl_pointer.rs Trait methods now take Rc<Self>, cursor accepts Option
src/wl_usr/usr_ifs/usr_wl_seat.rs Added get_keyboard method
src/wl_usr/usr_ifs/usr_wl_registry.rs Changed to use GlobalName type; simplified bind API
src/wl_usr.rs Extracted from_socket constructor; added OwnedFd import
src/wl_usr/usr_ifs.rs Registered new module declarations
src/state.rs Added pid, lazy_event_sources, XWayland client/display fields; centralized setter methods
src/compositor.rs New LogLevel enum, MIN_SCALE/MAX_SCALE constants, lazy event handler spawn
src/logger.rs Uses AtomicEnum<LogLevel> + separate filter for thread-safe log level
src/config/handler.rs Delegates to new State methods; removes local visitor helpers
src/theme.rs Added Oklab/Oklch color spaces, ThemeColor enum, StaticText impls
src/tree/toplevel.rs Added property_changed_source for lazy event notifications
src/tree/output.rs Changed VRR/tearing defaults; added set_flip_margin; head manager notifications
src/ifs/head_management.rs Added blend_space, use_native_gamut, vrr_cursor_hz to HeadState; ReadOnlyHeadState
src/output_schedule.rs Added head manager notification for cursor Hz changes
src/ifs/wp_cursor_shape_device_v1.rs Extracted from_shape/to_shape methods on KnownCursor
src/ifs/wl_seat.rs Added getter methods, PartialEq, input device setter wrappers
src/ifs/wl_output.rs Added PartialEq implementation
src/ifs/jay_compositor.rs Uses LogLevel::from_linear for log level setting
src/backend.rs Added Linearize/StaticText to input types; direct_scanout_enabled/flip_margin to trait
src/utils/event_listener.rs Added LazyEventSource/LazyEventSources; is_empty; new2
src/utils/atomic_enum.rs New AtomicEnum<T> for thread-safe enum storage
src/utils/static_text.rs New StaticText trait for display names
src/vulkan_core/gpu_alloc_ash.rs Moved from gfx_apis/vulkan/
src/scale.rs Renamed constants to SCALE_BASE/SCALE_BASEF (public)
src/kbvm.rs Added map_text field; keymap_from_rmlvo helper
src/cli.rs, src/cli/*.rs Updated to use LogLevel directly
src/portal*.rs Updated to use GlobalName; adapted to new callback/registry APIs
build/vulkan*.rs, compile-shaders/* Generalized shader compilation for multiple trees
src/client.rs Added StaticText for ClientCapsEnum
src/criteria/clm*.rs Added ClmMatchId for client ID matching
Other files Minor adaptations for new APIs

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

github-actions[bot]
github-actions bot previously approved these changes Mar 7, 2026
github-actions[bot]
github-actions bot previously approved these changes Mar 7, 2026
github-actions[bot]
github-actions bot previously approved these changes Mar 7, 2026
github-actions[bot]
github-actions bot previously approved these changes Mar 7, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 93 out of 94 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mahkoh mahkoh merged commit 94816ae into master Mar 7, 2026
8 checks passed
@mahkoh mahkoh deleted the jorth/refactoring branch March 7, 2026 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants