From 3d3057ae384ef7389284af8988410889e99c6bb9 Mon Sep 17 00:00:00 2001 From: srdusr <99972264+srdusr@users.noreply.github.com> Date: Wed, 29 May 2024 14:40:00 +0200 Subject: Config at ~/.config/srd; cursor shapes, key repeat, pin, mouse defaults Config path drops a level: ~/.config/srd, not ~/.config/srdwm/srd, which said the same thing twice. No other user-facing path had the same problem -- srdwm reads the config dir and writes nothing else. Cursor shapes. A client's own cursor surface is now rendered with the hotspot it declared, so an I-beam over text or a hand over a link shows the app's image instead of srdwm's arrow. The built-in arrow stays as the fallback when no client has set one, over decorations and the desktop. Named shapes still fall back to the arrow; most toolkits set a surface. Decorations and cursors now share one OverlayElement type, since render_output takes a single custom-element slice. Key repeat (srd.bind_repeat, Hyprland's binde). Held volume, brightness and switcher keys repeat at the seat's own rate rather than firing once. Driven from the poll loop, not a timer source: the winit backend has no calloop loop of its own, and poll_events already runs continuously in both backends. Repeat stops when *that* key is released, not when any key is. Always-on-top / pin, for the picture-in-picture and HUD rules that used it. Window::always_on_top was another declared-but-never-read field. Enforced in WindowManager's stacking order rather than at render time, so every consumer of stacking_order gets it and none can forget to honour it. Mouse-only window management, checked end to end: drag the titlebar to move, drag any edge or corner to resize, titlebar buttons to close/maximise/ minimise, click to focus, drag to a screen edge to snap, and now double-click the titlebar to maximise. The resize grab band went from 6px to 10px - a hairline is genuinely hard to hit with a mouse, which is why Hyprland ships extend_border_grab_area. Also removed the emoji status markers from docs/IMPLEMENTATION_STATUS.md. --- crates/wayland/src/elements.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 crates/wayland/src/elements.rs (limited to 'crates/wayland/src/elements.rs') diff --git a/crates/wayland/src/elements.rs b/crates/wayland/src/elements.rs new file mode 100644 index 0000000..f1fbfee --- /dev/null +++ b/crates/wayland/src/elements.rs @@ -0,0 +1,20 @@ +//! The one render-element type for everything srdwm draws *itself*, on top +//! of client windows: its titlebars and the mouse pointer. +//! +//! `render_output` takes a single `custom_elements` slice, so these have to +//! be one type. They come from two different sources - an uploaded bitmap +//! (titlebars, the built-in cursor arrow) and a client's own surface (a +//! client-set cursor image) - hence the two variants. + +use smithay::backend::renderer::element::memory::MemoryRenderBufferRenderElement; +use smithay::backend::renderer::element::surface::WaylandSurfaceRenderElement; +use smithay::backend::renderer::{ImportAll, ImportMem}; + +smithay::backend::renderer::element::render_elements! { + pub(crate) OverlayElement where + R: ImportAll + ImportMem; + /// A client's own surface, used for client-set cursor images. + Surface=WaylandSurfaceRenderElement, + /// A bitmap srdwm rasterised: a titlebar, or the built-in cursor arrow. + Memory=MemoryRenderBufferRenderElement, +} -- cgit v1.2.3