THE CRASH: peek reused scale_transformer_added_signal etc. from
<wayfire/plugins/scale-signal.hpp>. The built-in scale plugin keeps handlers
for those connected on every output for the whole session (scale_show_title_t
::init, called from scale::init - not on activation). When peek activated it
emitted scale_transformer_added_signal; scale's title-overlay handler then ran,
looked up a scene transformer literally named "scale" (peek's is named
"peek"), got null, and dereferenced it -> instant compositor crash on every
Alt+Tab for anyone with both plugins loaded. Nested tests missed it because
they didn't load scale.
Fix: src/peek-signal.hpp defines peek_{filter,end,update,transformer_added,
transformer_removed}_signal as distinct types; peek no longer includes or emits
any scale_* signal. Plus defensive null guards in the title-overlay handler.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Pn1wEpqpMDKEnyCHBATi5o
peek
A Windows-11-style Alt+Tab window switcher for the Wayfire compositor: a horizontal row of live window thumbnails that you cycle while holding the modifier and wrap around at the ends, with middle-click to close a window without leaving the switcher.
Wayfire's built-in switchers are either a 3D coverflow (switcher) or a
screen-filling exposé grid (scale). peek is a fork of scale — it keeps
scale's live-thumbnail engine and swaps in an Alt+Tab layout and interaction.
It is the Wayfire sibling of
kuri-peek-switcher
(same idea, for the COSMIC desktop).
Why a compositor plugin
Live per-window thumbnails can only be drawn by code running inside the
compositor — Wayfire 0.11 exposes only whole-output capture to external
clients, not per-window. So an external Alt+Tab app (wswitch, rofi-style
switchers, …) can never show real previews on Wayfire. peek runs in-process
and reads the scene graph directly, exactly like scale does.
Build
Requires Wayfire 0.11 and its development headers.
meson setup build
ninja -C build
sudo ninja -C build install
Installs libpeek.so into the Wayfire plugin directory and peek.xml into the
metadata directory. An Arch package is in packaging/ (also shipped through the
clockmost pkgs pipeline as wayfire-plugin-peek).
Use
Add peek to the plugins line in ~/.config/wayfire.ini and configure the
[peek] section:
[peek]
activate = <alt> KEY_TAB
activate_prev = <alt> <shift> KEY_TAB
middle_click_close = true
thumbnail_size = 260
| Input | Action |
|---|---|
Alt+Tab |
open; step forward (wraps) |
hold Alt, tap Tab |
keep stepping forward |
Alt+Shift+Tab |
step backward (wraps) |
| arrow keys | move between rows / columns |
release Alt / Enter |
activate the highlighted window |
Esc |
cancel, keep the original window focused |
| left-click a thumbnail | activate that window |
| middle-click a thumbnail | close that window, stay in the switcher |
See metadata/peek.xml for every option.
Relationship to upstream scale
peek is a hard fork of plugins/scale/ from Wayfire v0.11.0. See
VENDOR.md for the base commit and how to pull in later upstream
fixes. The middle_click_close crash present in stock scale is fixed here by
deferring view->close() to an idle callback so it never re-enters the input
dispatch.
License
MIT, inherited from Wayfire. See LICENSE.