"title · app" centred under each thumbnail, in the same font the rofi theme used (Berkeley Mono at pango's "small"), with the selected tile's label inverted onto the yellow the way rofi's element background did. Long titles are ellipsised to the cell width. Text comes from cosmic-text, which brings real shaping. The catch is cost: building a font system and rasterising the first glyphs takes ~55ms, nearly doubling a 65ms startup. But the capture phase is ~55ms of sitting blocked while the compositor copies pixels, so labels are shaped on a worker thread started before the captures and joined after them. The measured labels phase is now 0.0ms — it costs nothing in wall clock. Two thirds of that font cost was FontSystem::new() scanning all 1793 system faces, which even new_with_fonts() does. So the database is built by hand: the user's own font directories first, since they are small, and the full system scan only when the family isn't found there. An unknown family still resolves, because that fallback is exactly the system scan (verified: --font "No Such Font" renders in Noto). --hide-labels restores the icon-only grid, and --font/--font-size make the family and size settable. Adds a test that a label actually puts pixels on the surface, one for ellipsising, and one pinning the label row into the element geometry.
19 lines
510 B
TOML
19 lines
510 B
TOML
[package]
|
|
name = "wlgrid"
|
|
version = "0.1.0"
|
|
edition = "2024"
|
|
description = "Live window switcher for wlroots compositors: a thumbnail grid with the look of a rofi theme"
|
|
license = "MIT"
|
|
|
|
[dependencies]
|
|
wayland-client = "0.31"
|
|
wayland-protocols = { version = "0.32", features = ["client", "staging"] }
|
|
wayland-protocols-wlr = { version = "0.3", features = ["client"] }
|
|
memmap2 = "0.9"
|
|
rustix = { version = "1", features = ["fs", "mm", "shm"] }
|
|
swayipc = "4"
|
|
cosmic-text = "0.19"
|
|
|
|
[profile.release]
|
|
strip = true
|