linebender/druid
58.4
Adequate · 29 September 2026
52.1k
lines of production code
Rust
primary language
2
measurements over time
What this system is
This system is the Druid UI toolkit, a Rust-based framework for building cross-platform graphical user interfaces. It provides a platform abstraction layer via druid-shell to handle window management, input events, and rendering on Windows, macOS, Linux, and WebAssembly. The core druid crate offers a data-driven architecture featuring a Lens API for state binding, a modular text editing subsystem, and a comprehensive set of layout and interaction widgets.
How it got here
2018–2019 — Druid v0.8.3 initial workspace setup
11 changes.
This period established the Cargo workspace structure for Druid v0.8.3, introducing the foundational druid-shell crate with platform-agnostic abstractions for application lifecycle, window management, and input handling. The work included significant refactoring of derive macros for data and lens derivation, alongside the addition of new widget primitives and comprehensive test coverage. It also expanded the project with diverse examples, localization resources, and platform-specific extensions for Linux and macOS.
2020–2021 — Platform backends and Lens API
13 changes.
This period focused on establishing a unified, feature-flagged backend architecture for druid-shell, introducing native implementations for Windows, macOS, and Wayland alongside a shared Linux foundation. Concurrently, the core toolkit expanded with the Lens API for structured data binding, a modular text editing subsystem, and a data-driven menu system, supported by new web targets and comprehensive testing infrastructure.
2022 — Wayland backend modularization
4 changes.
This period focused on enhancing the druid-shell Wayland backend by introducing modular components for surface management, output detection, and shared XKB input handling. The work established a unified keyboard processing layer and added robust support for display metadata and overlay surfaces, improving consistency and extensibility across Linux environments.
Features
Add Druid web examples build infrastructure
Introduces a new build system for running Druid examples in the browser. The \build.rs\ script automatically generates HTML pages and JavaScript bindings for each example, while \src/lib.rs\ exposes these examples via \wasm\_bindgen\. Several examples (markdown\_preview, svg, async\_event, blocking\_function, sub\_window, input\_region) are explicitly excluded from the web build due to platform limitations.
druid/examples/web · high confidence
Add Druid web hello world example
A new example application demonstrating how to build and run a Druid UI for the web using WebAssembly. It includes the necessary HTML, JavaScript, and Rust source files to launch a simple window with a label and text input, serving as a minimal reference for web-target Druid development.
_druid/examples/hello\web · high confidence
Add Linux locale detection utility
The Linux backend now includes a shared utility for detecting the system locale. This new \env\ module provides a \locale()\ function that determines the user's preferred language by checking standard environment variables (LANGUAGE, LC\_ALL, LC\_MESSAGES, LANG) in priority order, falling back to 'en-US' if none are set, and normalizes the result by stripping encoding suffixes to match the expected Unicode locale format.
druid-shell/src/backend/shared/linux · high confidence
Add animation and SVG asset examples
The examples directory now includes a new \anim.rs\ example demonstrating how to create a widget that requests and handles animation frames to draw a rotating line, and a new \tiger.svg\ asset file to support SVG-based examples.
druid/examples · high confidence
Added built-in localization resources for German, English, and French Canadian
New localization files have been added to the application's resource directory, providing built-in translations for the application name, menu items (such as File, Edit, and macOS-specific menus), and basic UI strings in German (de-DE), English (en-US), and French Canadian (fr-CA). This enables the application to display its interface in these languages out of the box.
druid/resources · high confidence
Initial Wayland backend implementation for Druid
This change introduces a new Wayland platform backend for the Druid GUI toolkit, adding a complete set of modules to handle window management, input events, and system integration on Wayland compositors. The implementation includes \application.rs\ for core event loop and seat management, \keyboard.rs\ and \pointers.rs\ for handling XKB keyboard state and mouse input with click debouncing, and \clipboard.rs\ for system pasteboard interactions. It also provides \display.rs\ for Wayland global event dispatching, \screen.rs\ for monitor detection, and \window.rs\ for surface creation and basic window operations (show, hide, resize, close). Several features such as resizing, titlebar visibility, and always-on-top are currently marked as unimplemented with warnings, reflecting the initial state of this backend.
(repo-wide) · high confidence
Introduce platform-agnostic application shell and core UI abstractions
This change establishes the foundational \druid-shell\ crate, providing a unified platform abstraction layer for the Druid UI toolkit. It introduces the \Application\ type to manage the global application lifecycle and run loop, alongside a rewritten \Clipboard\ API that supports multi-format data exchange. The update brings a comprehensive set of core types including \KeyEvent\ and \HotKey\ for standardized keyboard input, \MouseEvent\ and \MouseButtons\ for pointer events, and \FileDialogOptions\ for cross-platform file dialogs. Additionally, it adds \Region\ for partial invalidation, \Scale\ for resolution-independent coordinates, and \Menu\ for window and context menus, effectively replacing previous platform-specific implementations with a consistent, portable API.
druid-shell/src · high confidence
Introduction of a modular text editing subsystem
The text handling capabilities have been reorganized into a dedicated \druid::text\ module, introducing a comprehensive set of new types and traits for managing text input and display. This includes the \EditableText\ trait for abstracting text storage (with implementations for \String\ and \Arc\<String\>\), the \TextLayout\ component for rendering and measuring text with support for alignment and wrapping, and the \TextComponent\ widget for handling platform-level IME and input events. Additionally, rich text styling is now supported via \RichText\ and \RichTextBuilder\, allowing for per-span attributes like font family, color, and weight, as well as clickable \Link\ spans. The module also provides utilities for text movement, backspace logic, and input validation through the \Formatter\ trait.
druid/src/text · high confidence
Introduction of data-driven menu system with platform-specific defaults
The menu module has been refactored to follow a data-driven design, where menus update their text and status based on application data changes (refreshes) or can be fully rebuilt from scratch when triggered. This change introduces a \MenuManager\ to handle menu lifecycle and event routing, and provides pre-configured, platform-appropriate menu items and structures in \sys.rs\, including common actions (cut, copy, paste, undo, redo) and platform-specific defaults for macOS (application menu bar) and Windows (file menu).
druid/src/menu · high confidence
Introduction of the Lens API for data access
The \druid/src/lens\ module has been added, introducing the \Lens\ trait and \LensExt\ extension trait to allow widgets to access and modify specific subfields of larger data structures. This change enables users to bind widgets (like \TextBox\) to nested data fields using the \lens!\ macro or derived lenses, supporting operations such as composition (\then\), mapping (\map\), dereferencing (\deref\), and array indexing (\index\).
druid/src/lens · high confidence
New and updated shell examples demonstrating core platform capabilities
The druid-shell/examples directory now includes several new demonstration applications: edit\_text.rs shows a single-line text field with selection and composition support; invalidate.rs demonstrates partial invalidation and rect-based repaints; perftest.rs provides a performance benchmark with a VSYNC indicator; quit.rs illustrates application lifecycle and menu-based quitting; and shello.rs serves as a comprehensive example covering file dialogs, keyboard/mouse events, timers, and focus handling. These examples showcase the current state of the druid-shell API for window management, input handling, and rendering.
druid-shell/examples · high confidence
New macOS backend implementation for druid-shell
This change introduces the complete macOS backend implementation for the druid-shell crate, replacing the previous platform-specific code. It provides native integration with macOS AppKit for core application features including the main event loop, application lifecycle management, and system clipboard operations. The implementation adds support for macOS-native file open and save dialogs with file type filtering, full menu system handling with hotkey support, and comprehensive keyboard event translation. It also includes window management capabilities with support for different window levels, input region handling, and always-on-top behavior, along with text input handling for composition and selection, screen/monitor information retrieval, and mouse tracking area management.
druid-shell/src/backend/mac · high confidence
New value formatting example demonstrating text validation and currency formatting
The \druid/examples/value\_formatting\ example has been added to demonstrate how to use the \Formatter\ trait with \TextBox\ widgets for input validation and display customization. It includes implementations for formatting currency values (USD, Euros, GBP) with localized separators, validating Canadian postal codes, and selecting specific text patterns. The example also showcases custom error handling via a \TextBoxErrorDelegate\ and \ErrorController\ to display validation feedback to users.
_druid/examples/value\formatting · high confidence
New widget primitives: Added, Align, AspectRatioBox, and Click controller
The widget module introduces several new layout and interaction primitives. The \Added\ controller allows users to execute a closure when a child widget is added to the tree. The \Align\ widget provides flexible child alignment with options for horizontal, vertical, or full alignment, including support for width/height factors. The \AspectRatioBox\ widget constrains its child to maintain a specific width-to-height ratio. Additionally, the \Click\ controller enables making arbitrary widgets interactive by handling mouse events and invoking a callback on click, serving as a lightweight alternative to the \Button\ widget for custom interactive elements.
druid/src/widget · high confidence
Platform-specific application extensions for Linux and macOS
This change introduces platform-specific extension traits for the \Application\ type, allowing access to OS-level features. On Linux, the new \ApplicationExt\ trait provides a \primary\_clipboard\ method to access the primary system clipboard, which is useful for middle-mouse paste functionality. On macOS, the \ApplicationExt\ trait exposes methods to \hide\ the application, \hide\_others\, and \set\_menu\ for the global application menu. These extensions are conditionally compiled based on the target operating system (Linux, FreeBSD, OpenBSD for the Linux module; macOS for the Mac module) and are exposed through the platform module structure.
druid-shell/src/platform · high confidence
Wayland output detection and metadata support
The Wayland backend now includes a new module for detecting display outputs and gathering their metadata. It registers for \wl\_output\ and \zxdg\_output\_v1\ global events to collect information such as logical and physical dimensions, position, scale, refresh rate, and device identifiers. The implementation handles output addition and removal events, normalizes dimensions for rotated screens, and exposes this data through a structured API for use by the windowing system.
druid-shell/src/backend/wayland/outputs · high confidence
Windows backend implementation added
A new Windows backend has been added to druid-shell, providing native support for window management, input handling, and system integration on Windows. This includes a complete message loop implementation in the application module, keyboard and key-code translation, accelerator table handling for hotkeys, menu and dialog support, clipboard access, and Direct2D/DirectComposition-based rendering. The backend also handles screen enumeration, timer management, and error reporting specific to the Windows API.
druid-shell/src/backend/windows · high confidence
Behavioural changes
Redesigned application lifecycle and window management API
The application entry point and window configuration have been restructured to support sub-windows and more granular control. \AppLauncher\ now manages a list of \WindowDesc\ instances instead of a single window, allowing multiple windows to be defined at launch. \WindowDesc\ has been split into a builder (\PendingWindow\) and a configuration struct (\WindowConfig\), exposing properties like \min\_size\, \resizable\, and \transparent\ for easier setup. A new \AppDelegate\ trait replaces the previous application handler, providing hooks for window creation (\window\_added\), removal (\window\_removed\), and global command handling via \DelegateCtx\. Additionally, \WindowConfig\ now uses \Size\ directly for minimum size constraints instead of \Option\<Size\>\, simplifying the API for setting window bounds.
druid/src · high confidence
Refactored derive macros to support granular field attributes and associated constants
The \druid-derive\ crate has been restructured into separate modules for \Data\ and \Lens\ derivation, introducing new field-level attributes. For \\#\[derive(Data)\]\, users can now use \\#\[data(ignore)\]\ to skip fields in equality checks, \\#\[data(eq)\]\ as a shorthand for \PartialEq::eq\, and \`\#\[data(same\_fn=
druid-derive/src · high confidence
Shared XKB input handling for Wayland and X11 backends
A shared XKB (X Keyboard Extension) module has been introduced in the \druid-shell\ backend to unify keyboard input processing across both Wayland and X11 platforms. This change adds a common implementation layer (\druid-shell/src/backend/shared/xkb\) that wraps the \xkbcommon\ library, providing consistent key code mapping, modifier state tracking, and key event generation. By decoupling the keyboard logic from platform-specific window handles, the application now ensures uniform keyboard behavior and layout handling regardless of whether it is running on a Wayland or X11 session.
druid-shell/src/backend/shared/xkb · high confidence
Shared keyboard and timer logic for Linux/FreeBSD/OpenBSD backends
The druid-shell backend for Linux, FreeBSD, and OpenBSD now uses a shared module for core input and timing logic. This change introduces a hardware keycode-to-Code mapping and a Code-to-Location mapping in the new keyboard module, ensuring consistent key identification across X11 and Wayland implementations. Additionally, a shared timer module is added to manage scheduled events using a binary heap ordered by deadline, replacing or supplementing backend-specific timer handling.
druid-shell/src/backend/shared · high confidence
Unified backend module with platform-specific feature flags
The \druid-shell/src/backend\ module has been restructured to consolidate platform-specific implementations under a single entry point. This change introduces conditional compilation based on the target operating system and enabled features: Windows and macOS use their native backends, while Linux, FreeBSD, and OpenBSD now support X11, Wayland, or GTK (as a fallback) depending on feature flags. Additionally, WebAssembly (wasm32) support is included. This allows users to select the appropriate windowing system for their platform via feature flags rather than separate modules.
druid-shell/src/backend · high confidence
Wayland surface backend refactored into modular components
The Wayland surface implementation has been restructured into distinct modules for buffers, idle callbacks, layer-shell surfaces, popups, and top-level windows. This change decouples buffer management from surface state, enabling more robust buffer recreation and size handling, while introducing dedicated support for layer-shell surfaces (enabling overlay/underlay window placement) and refined popup positioning via XDG positioners. Idle callbacks are now queued and executed safely, and the compositor handle logic is centralized to manage scale recomputation and surface creation uniformly across all surface types.
druid-shell/src/backend/wayland/surfaces · high confidence
druid-shell marked as unmaintained with new build script
The druid-shell crate is now explicitly documented as UNMAINTAINED, recommending users migrate to Winit. Additionally, a new build.rs script has been added to generate Rust bindings for xkbcommon (including xkbcommon-x11 when the x11 feature is enabled) on Linux, FreeBSD, and OpenBSD, ensuring proper compilation of keyboard input handling for supported platforms.
druid-shell · high confidence
Test coverage
Added UI tests for Lens derive macro validation; Added tests for druid-derive macros; New widget testing harness and helper utilities.
Dependencies
Initial workspace setup and dependency configuration for Druid v0.8.3
This change establishes the Cargo workspace structure for the Druid UI toolkit, defining the root \Cargo.toml\ and configuring the core crates (\druid\, \druid-shell\, \druid-derive\) and example projects. It sets the project version to 0.8.3 and configures dependencies such as \piet-common\ (v0.7.0-cairo18), \tracing\, and platform-specific libraries like \gtk-rs\, \x11rb\, and \wayland-client\. The configuration also enables optional features for image formats, SVG rendering, and localization, while pinning specific versions for build tools like \bindgen\ and \pkg-config\ to ensure reproducible builds.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 57 → 58 (+1.5)
- Rubric changed (rubric-2026.09.8 → rubric-2026.09.17) — scores are not directly comparable.
Lenses
- Code Health 82 → 82 (+0.0)
- Architecture 100 → 85 (-14.8)
- Maturity 45 → 45 (+0.0)
- Readiness 68 → 66 (-2.5)
- Security 51 → 61 (+9.9)
- Event Sourcing 100 → 100 (+0.0)
- Performance 100 (new)
Resolved (3)
- Documentation: no architecture or design documentation (README.md)
- Documentation: no usage examples (README.md)
- Documentation: written for insiders (docs/src/01_overview.md)
New (22)
- Duplicate intent with confusing naming. submit_notification and submit_notification_without_warning perform the same core action (submitting a command/notification). The distinction is based on a side-effect (warning if unused), which is an implementation detail rather than a fundamental behavioral difference. This forces the user to know about the 'unused warning' mechanism to choose the correct API.
- Inconsistent boolean property naming. has_focus uses the has_ prefix, while is_hot uses the is_ prefix. In Rust APIs, consistency in boolean method naming (either all is_ or all has_) is preferred for discoverability. is_active and is_initialized also use is_, making has_focus the outlier.
- Inconsistent parameter types for the same operation. WindowConfig.set_position takes Point, while WindowDesc.set_position takes impl Into<Point>. While Point likely implements Into<Point>, the explicit difference in signature suggests a lack of standardization in how positional data is accepted across similar configuration types. If Point is the canonical type, both should accept impl Into<Point> for flexibility (e.g., accepting tuples or arrays if defined).
- Off the main sequence: druid-shell
- Outdated: anyhow
- Outdated: cfg-if
- Outdated: chrono
- Outdated: futures
- Outdated: js-sys
- Outdated: log
- Outdated: once_cell
- Outdated: pkg-config
- Outdated: proc-macro2
- Outdated: quote
- Outdated: time
- Outdated: tracing
- Outdated: tracing-subscriber
- Outdated: unicode-segmentation
- Outdated: wasm-bindgen
- Outdated: web-sys
- …and 2 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
linebender/druid was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 29 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 0f8b1195e4e073f9597f2865299c3d18f8e4005f — the exact code this score is about.
- Scored under rubric-2026.09.17 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-fbec9b1e08c2.