VEIL Window Manager

VEIL Window Manager (VWM) is a dynamic window management addon for the VEIL platform. It provides automatic BSP tiling, floating, and stacking layouts for Windows — written in Rust with native Win32 API integration.

VWM hooks into Windows accessibility event hooks to react to window events in real time, debounces retile operations for performance, and exposes a YAML config that is watched for changes and hot-reloaded without restarting.

Platform: VWM targets Windows only. It requires the VEIL platform to be installed and running.

Installation

VWM ships as a VEIL addon. Place the addon folder in your VEIL addons directory and VEIL will discover and launch it automatically.

Addon directory structure

Directory layout
Shell
~/ProjectOpen/VEIL/addons/windowmanager/
├── addon.json          # Addon manifest
├── bin/
│   └── veil-windowmanager.exe
└── config.yaml         # Your configuration

addon.json

The manifest tells VEIL how to load the addon:

addon.json
JSON
{
  "id":       "veil.addon.windowmanager",
  "name":     "Window Manager",
  "package":  "windowmanager",
  "exe_path": "bin/veil-windowmanager.exe",
  "version":  "1.0.0",
  "repo":     "https://github.com/TheIco2/VWM"
}

Quick Start

Create a minimal config.yaml to get tiling running immediately:

config.yaml — minimal
YAML
window_manager:
  enabled: true
  manager_type: tiling
  monitor_index:
    - "*"

Save the file. VWM will detect the change and retile open windows within the configured debounce window.

Config Reference

The full schema for config.yaml:

config.yaml — full schema
YAML
update_check: true
debug: false
log_level: warn   # trace | debug | info | warn | error

universal:
  exclude_processes:
    - "ShellExperienceHost.exe"
    - "taskmgr.exe"
    - "systemsettings.exe"
    - "steamwebhelper.exe"
    - "msiexec.exe"

window_manager:
  enabled: true
  manager_type: tiling   # tiling | floating | stacking
  monitor_index:
    - "*"               # "*" = all, or "0", "1", etc.

  animation:
    enabled: true
    duration: 150      # ms

  styling:
    gap:
      space: 10         # pixels
      behavior: "Shared"  # Shared | PerWindow

  events:
    debounce_ms: 500

  filters:
    min_width: 1
    min_height: 1
    include_processes: []
    exclude_processes: []
    exclude_classes:
      - "Shell_TrayWnd"
      - "Progman"
      - "WorkerW"
      - "Windows.UI.Core"
      - "ApplicationFrameWindow"
    exclude_titles:
      - "Program Manager"
      - "NVIDIA GeForce Overlay"
      - "Task Manager"
      - "Settings"

Universal Filters

The universal block applies exclusions across all VEIL addons, not just the window manager. Processes listed here are always ignored regardless of addon-level config.

exclude_processes

A list of process executable names to exclude globally. Matching is case-insensitive and exact.

Example
YAML
universal:
  exclude_processes:
    - "taskmgr.exe"
    - "systemsettings.exe"
    - "msiexec.exe"

Window Filters

The filters block under window_manager provides fine-grained control over which windows VWM manages.

Dimension filters

min_width and min_height define the minimum size a window must have to be managed. Useful for ignoring small utility popups.

Process filters

include_processes — if non-empty, only these processes are managed.
exclude_processes — these processes are always skipped.

Note: include_processes takes priority. If it has entries, all processes not on the list are excluded even if not in exclude_processes.

Class filters

exclude_classes matches against the Win32 window class name using a substring check. Useful for excluding system shell windows.

Title filters

exclude_titles matches against the window title using a substring check (case-insensitive).

Automatic exclusions

VWM automatically skips windows that are:

  • Hidden or minimized
  • Cloaked (virtual desktop hidden)
  • Tooltips or popup menus
  • Borderless / captionless windows
  • True fullscreen applications

Animations

VWM smoothly moves windows to their new positions after a retile. The animation block controls this behaviour.

KeyTypeDefaultDescription
enabledbooltrueToggle all animations on/off
durationinteger150Animation duration in milliseconds
Example — fast animations
YAML
animation:
  enabled: true
  duration: 80

Styling & Gaps

Configure the pixel gap between managed windows and how it is distributed.

KeyTypeDefaultDescription
gap.spaceinteger10Gap size in pixels
gap.behaviorstringSharedShared — gap is split between borders. PerWindow — each window gets the full gap on each side.

Events

VWM listens to Windows accessibility events and retiles whenever windows are opened, closed, moved, or resized. To avoid thrashing during rapid changes, retile operations are debounced.

KeyTypeDefaultDescription
debounce_msinteger500Milliseconds to wait after the last event before triggering a retile
Lower values make the manager more responsive but may cause extra work during window drag operations. 200–500ms is a good range for most setups.

BSP Tiling Layout

Set manager_type: tiling to enable the binary space partitioning layout. Each new window splits the screen (or the focused tile) in half, creating a balanced tree.

How BSP works

  1. The first window occupies the full work area.
  2. The second window splits the first tile horizontally or vertically.
  3. Each subsequent window splits the currently focused tile.
  4. When a window is closed, its sibling expands to fill the space.

Drag-to-reorder

Drag a window over another managed window to swap their positions in the BSP tree. The layout is updated immediately after the drag is released.

Edge-drag resizing

Grab any window edge and drag to resize. VWM intercepts the resize event and adjusts the BSP split point so that both the dragged window and its sibling resize together, keeping the tree intact.

Floating Layout

Set manager_type: floating to disable automatic tiling. Windows retain their natural positions and VWM does not move them.

Filters, universal exclusions, and IPC communication remain active in floating mode — only the automatic positioning is disabled.

Stacking Layout

Set manager_type: stacking to stack all managed windows on top of each other, each filling the full work area. Only the top-most window is visible at a time.

This mode is useful for single-task focus sessions or when combined with IPC commands to programmatically cycle through windows.

Multi-Monitor Support

VWM maintains an independent BSP state for each managed monitor. Windows are assigned to monitors based on which monitor contains the majority of the window's area.

Targeting monitors

Use the monitor_index list to control which monitors VWM manages:

Examples
YAML
# All monitors
monitor_index:
  - "*"

# Only the primary monitor
monitor_index:
  - "0"

# Two specific monitors
monitor_index:
  - "0"
  - "1"

Boundary detection

VWM uses smart boundary-aware edge detection to prevent windows from being dragged across monitor boundaries during edge-resize operations.

Architecture

VWM is structured as a set of focused modules:

Module overview
Text
main.rs           ← IPC listener & event loop entry point
bootstrap.rs      ← Addon startup, config loading
config.rs         ← Config deserialization (serde + YAML)
layout.rs         ← Tiling / Floating / Stacking logic
types.rs          ← Core data structures (WindowState, Monitor...)
display_provider  ← Monitor enumeration & geometry
ipc_connector     ← VEIL IPC integration
watchers.rs       ← File-system config hot-reload (notify crate)
logging.rs        ← Structured log output
window_events/    ← SetWinEventHook setup, cleanup, dispatch
window_ops/       ← Window enumeration, BSP, positioning, resize

Event flow

  1. Windows fires an accessibility event (window created, moved, etc.).
  2. window_events/event_manager.rs receives and classifies the event.
  3. A debounce timer resets; after debounce_ms elapses, a retile is triggered.
  4. window_ops/window_enumeration.rs collects all visible managed windows.
  5. layout.rs computes the new positions via the active layout algorithm.
  6. window_ops/positioning.rs calls SetWindowPos for each window.

IPC Integration

VWM connects to the VEIL IPC layer on startup. This enables other VEIL components and addons to send commands to the window manager at runtime — for example, to switch the active layout or request a retile.

Note: Full IPC command documentation will be published here once the IPC API is stabilised. Check the GitHub repo for the latest updates.

Building from Source

VWM requires a stable Rust toolchain targeting x86_64-pc-windows-msvc.

Build steps
Shell
# Install Rust (if needed)
winget install Rustlang.Rustup

# Clone the repo
git clone https://github.com/TheIco2/VWM.git
cd VWM

# Release build
cargo build --release

# Output
target/release/veil-windowmanager.exe

Debug build

Debug
Shell
cargo build
# Outputs: target/debug/veil-windowmanager.exe
# Set log_level: debug in config.yaml for verbose output