From 43175c78a5b450eb108738187b72e80d36a7bf5d Mon Sep 17 00:00:00 2001 From: srdusr <99972264+srdusr@users.noreply.github.com> Date: Tue, 2 Apr 2024 01:07:00 +0200 Subject: Add window rules, real config validation, and a Wayland DRM/udev backend - srd.rule(): match windows by title/class, apply floating/maximized/ workspace/geometry/decoration actions on creation (crates/core/src/rules.rs) - srd.validate_config()/srd.debug.*: real range/format checks and status/profiling helpers, replacing the always-true stub - Wayland titlebar text rendering via fontdue, unit-tested without a display (crates/wayland/src/decoration.rs) - Wayland precise keybinding matching, replacing the "any Super-held key" heuristic, sharing the keysym table with X11 (moved to crates/core/src/keysyms.rs) - Wayland DRM/udev backend (crates/wayland/src/udev.rs): runs as the real compositor on a bare TTY via libseat/libinput/KMS, software rendering via Pixman + dumb buffers (no GBM/EGL required) - srdwm_platform::detect() fix, found via VM testing: a bare TTY with no DISPLAY/WAYLAND_DISPLAY now correctly resolves to Wayland instead of an X11 backend that can never work there - XWayland integration groundwork (crates/wayland/src/xwayland.rs): spawn, X11Wm, and full XwmHandler event routing into the same WindowManager/ Space pipeline as native clients. Windows don't render yet - a real glamor-vs-software-renderer conflict in XWayland's own fallback path, root-caused via WAYLAND_DEBUG tracing and documented in docs/IMPLEMENTATION_STATUS.md rather than worked around blind. All verified live in an isolated QEMU VM: X11 backend shows two decorated, correctly-tiled xterms with real title text; the DRM/udev Wayland backend opens the GPU, initializes input, and scans out a rendered frame via KMS page-flip. --- config/srd/rules.lua | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'config/srd/rules.lua') diff --git a/config/srd/rules.lua b/config/srd/rules.lua index 576333a..9435f69 100644 --- a/config/srd/rules.lua +++ b/config/srd/rules.lua @@ -1,6 +1,13 @@ -- Window rules (match-by-title/class -> action). +- Window rules (match-by-title/class -> action), applied once when a +- matching window is first created. -- -- A dedicated `srd.rule(...)` API is not implemented yet - see -- docs/IMPLEMENTATION_STATUS.md. For now, achieve the same effect from -- srd.bind()'d keys or by reacting to srd.window.focused() in your own -- functions. This file is intentionally a no-op placeholder. +- srd.rule(matcher, actions) +-- matcher: { title = "substring, case-insensitive", class = "exact app_id/WM_CLASS, case-insensitive" } +-- at least one of title/class is required - an empty matcher matches nothing. +-- actions: { floating = bool, maximized = bool, workspace = id, +-- x = .., y = .., width = .., height = .., +-- decorated = bool, border_color = {r,g,b}, border_width = px } +-- +- Examples: +- srd.rule({ class = "pavucontrol" }, { floating = true }) +- srd.rule({ title = "picture-in-picture" }, { floating = true, width = 480, height = 270 }) -- cgit v1.2.3