MCPcopy Index your code
hub / github.com/Smithay/smithay

github.com/Smithay/smithay @v0.7.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.7.0 ↗ · + Follow
4,760 symbols 13,512 edges 290 files 1,368 documented · 29%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Smithay

Crates.io docs.rs Build Status Join the chat on matrix at #smithay:matrix.org Join the chat via bridge on #smithay on libera.chat

A smithy for rusty wayland compositors

Goals

Smithay aims to provide building blocks to create wayland compositors in Rust. While not being a full-blown compositor, it'll provide objects and interfaces implementing common functionalities that pretty much any compositor will need, in a generic fashion.

It supports the core Wayland protocols, the official protocol extensions, and some external extensions, such as those made by and for wlroots and KDE

Also:

  • Documented: Smithay strives to maintain a clear and detailed documentation of its API and its functionalities. Compiled documentations are available on docs.rs for released versions, and here for the master branch.
  • Safety: Smithay will target to be safe to use, because Rust.
  • Modularity: Smithay is not a framework, and will not be constraining. If there is a part you don't want to use, you should not be forced to use it.
  • High-level: You should be able to not have to worry about gory low-level stuff (but Smithay won't stop you if you really want to dive into it).

Anvil

Smithay as a compositor library has its own sample compositor: anvil.

To get informations about it and how you can run it visit anvil README

Other compositors that use Smithay

  • Cosmic: Next generation Cosmic desktop environment
  • Catacomb: A Wayland Mobile Compositor
  • MagmaWM: A versatile and customizable Wayland Compositor
  • Niri: A scrollable-tiling Wayland compositor
  • Strata: A cutting-edge, robust and sleek Wayland compositor
  • Pinnacle: A WIP Wayland compositor, inspired by AwesomeWM
  • Sudbury: Compositor designed for ChromeOS
  • wprs: Like xpra, but for Wayland, and written in Rust.

System Dependencies

(This list can depend on features you enable)

  • libwayland
  • libxkbcommon
  • libudev
  • libinput
  • libgbm
  • libseat
  • xwayland

Contact us

If you have questions or want to discuss the project with us, our main chatroom is on Matrix: #smithay:matrix.org.

Extension points exported contracts — how you extend this code

IsAlive (Interface)
Trait that is implemented on wayland objects tracked by Smithay [22 implementers]
src/utils/alive_tracker.rs
Buffer (Interface)
Common trait describing common properties of most types of buffers. [6 implementers]
src/backend/allocator/mod.rs
TouchGrab (Interface)
A trait to implement a touch grab In some context, it is necessary to temporarily change the behavior of the touch hand [6 …
src/input/touch/grab.rs
WaylandFocus (Interface)
Focused objects that *might* have an underlying wl_surface. [7 implementers]
src/wayland/seat/mod.rs
SpaceElement (Interface)
Element mappable onto a [`Space`](super::Space) [5 implementers]
src/desktop/space/element/mod.rs
Backend (Interface)
(no doc) [4 implementers]
anvil/src/state.rs
X11Relatable (Interface)
Trait for objects, that represent an x11 window in some shape or form and can be tested for equality. [2 implementers]
src/xwayland/xwm/surface.rs
CrtcMapper (Interface)
CRTC Mapper trait It exists to allow custom mappers in [`super::DrmScanner`]. It is responsible for mapping CRTCs to c [1 …
smithay-drm-extras/src/drm_scanner/crtc_mapper.rs

Core symbols most depended-on inside this repo

lock
called by 640
src/wayland/session_lock/mod.rs
map
called by 369
src/backend/x11/mod.rs
iter
called by 286
src/backend/allocator/format.rs
push
called by 242
src/wayland/keyboard_shortcuts_inhibit/mod.rs
as_ref
called by 212
src/backend/drm/gbm.rs
clone
called by 211
src/wayland/output/mod.rs
iter
called by 199
src/utils/user_data.rs
clone
called by 182
src/input/mod.rs

Shape

Method 3,406
Class 718
Function 341
Enum 169
Interface 126

Languages

Rust100%
C1%

Modules by API surface

src/backend/drm/compositor/mod.rs106 symbols
src/utils/geometry.rs95 symbols
src/wayland/shell/xdg/mod.rs89 symbols
src/xwayland/xwm/surface.rs86 symbols
src/backend/renderer/gles/mod.rs82 symbols
src/backend/renderer/multigpu/mod.rs81 symbols
src/backend/input/mod.rs72 symbols
src/input/keyboard/mod.rs70 symbols
src/xwayland/xwm/mod.rs55 symbols
src/backend/renderer/pixman/mod.rs55 symbols
src/backend/allocator/dmabuf.rs55 symbols
src/input/pointer/mod.rs53 symbols

For agents

$ claude mcp add smithay \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page