MCPcopy Index your code
hub / github.com/ericcurtin/wayoa

github.com/ericcurtin/wayoa @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
462 symbols 771 edges 37 files 296 documented · 64%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Wayoa

A Wayland compositor for macOS, using Metal for rendering and Cocoa for windowing.

Overview

Wayoa is a full-featured Wayland compositor where each Wayland toplevel surface maps to a native macOS window. This allows running Linux/Wayland applications on macOS with native window management.

Features

  • Native macOS Windows: Each Wayland toplevel becomes an NSWindow
  • Metal Rendering: GPU-accelerated surface composition using Apple's Metal API
  • Full Wayland Protocol Support:
  • Core: wl_compositor, wl_surface, wl_shm, wl_output
  • XDG Shell: xdg_wm_base, xdg_surface, xdg_toplevel, xdg_popup
  • Input: wl_seat, wl_keyboard, wl_pointer
  • Extensions: wlr-layer-shell, wlr-screencopy
  • XKB Keyboard Support: Full keyboard mapping with XKB integration
  • HiDPI Support: Retina display aware with proper scaling

Architecture

┌──────────────────────────────────────────────────────────────────┐
│                      Wayland Clients                             │
└──────────────────────────┬───────────────────────────────────────┘
                           │ Unix Socket (Wayland Protocol)
┌──────────────────────────▼───────────────────────────────────────┐
│                         WAYOA                                    │
│  ┌────────────────────────────────────────────────────────────┐  │
│  │  Protocol Layer (wayland-server-rs)                        │  │
│  │  • wl_display, wl_registry, wl_compositor                  │  │
│  │  • xdg_shell, xdg_surface, xdg_toplevel, xdg_popup         │  │
│  │  • wl_seat, wl_keyboard, wl_pointer                        │  │
│  │  • wl_shm, wl_buffer                                       │  │
│  │  • wl_output, wl_data_device                               │  │
│  │  • wlr-layer-shell, wlr-screencopy                         │  │
│  └────────────────────────────────────────────────────────────┘  │
│  ┌────────────────────────────────────────────────────────────┐  │
│  │  Compositor Core                                           │  │
│  │  • Surface Manager (tracks all surfaces, damage, commits)  │  │
│  │  • Window Manager (maps toplevels to NSWindows)            │  │
│  │  • Input Router (keyboard focus, pointer grab)             │  │
│  │  • Seat (manages input devices)                            │  │
│  │  • Output Manager (monitors → wl_output)                   │  │
│  └────────────────────────────────────────────────────────────┘  │
│  ┌────────────────────────────────────────────────────────────┐  │
│  │  Cocoa Backend                                             │  │
│  │  • NSApplication event loop integration                    │  │
│  │  • WayoaWindow (NSWindow subclass per toplevel)            │  │
│  │  • WayoaView (NSView with CAMetalLayer)                    │  │
│  │  • Input event translation (NSEvent → Wayland events)      │  │
│  └────────────────────────────────────────────────────────────┘  │
│  ┌────────────────────────────────────────────────────────────┐  │
│  │  Metal Renderer                                            │  │
│  │  • Texture upload from wl_shm buffers                      │  │
│  │  • Surface composition (subsurfaces, popups)               │  │
│  │  • Damage tracking for efficient redraw                    │  │
│  └────────────────────────────────────────────────────────────┘  │
└──────────────────────────────────────────────────────────────────┘

Usage

When running Wayoa, it creates a Wayland socket that clients can connect to:

# Set the Wayland display
export WAYLAND_DISPLAY=wayland-0

# Run a Wayland client (e.g., from a cross-compiled Linux environment)
./my-wayland-app

Core symbols most depended-on inside this repo

contains
called by 15
src/protocol/compositor.rs
remove
called by 15
src/compositor/window.rs
get
called by 14
src/compositor/window.rs
get_mut
called by 12
src/compositor/window.rs
get
called by 9
src/protocol/screencopy.rs
get_mut
called by 8
src/protocol/screencopy.rs
add
called by 6
src/compositor/output.rs
handle
called by 5
src/backend/event_loop.rs

Shape

Method 297
Class 79
Function 67
Enum 19

Languages

Rust100%

Modules by API surface

src/compositor/window.rs30 symbols
src/input/pointer.rs27 symbols
src/compositor/surface.rs27 symbols
src/protocol/shell.rs26 symbols
src/protocol/layer_shell.rs25 symbols
src/compositor/output.rs25 symbols
src/protocol/shm.rs24 symbols
src/protocol/data_device.rs24 symbols
src/input/keyboard.rs23 symbols
src/backend/cocoa/window.rs23 symbols
src/protocol/screencopy.rs22 symbols
src/input/seat.rs21 symbols

For agents

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

⬇ download graph artifact