Skip to content
AD
← All projects
OPEN SOURCERUST · WAYLANDUPSTREAM REVIEW OPEN

Bringing real window thumbnails to COSMIC Alt-Tab.

Two complementary upstream contributions connect Wayland window capture in the launcher service with thumbnail rendering in COSMIC's Rust/Iced interface. The code was tested locally; both pull requests remain open.

The problem

Alt-Tab needed more than a window title.

A useful window switcher should help identify windows visually, even when multiple windows have similar titles. COSMIC's launcher and frontend live in separate repositories, and window content can change without a corresponding title update.

The change therefore needed a capture path, a portable data representation, asynchronous result updates, and an interface that stays responsive while images are loading.

Architecture

From Wayland surface to Alt-Tab preview.

A simplified sequence based on the two submitted implementations, not a screenshot or an invented UI.

  1. 01

    Capture

    The cosmic_toplevel plugin requests foreign toplevel screenshots through COSMIC's Wayland screencopy protocol.

  2. 02

    Convert and cache

    Captured shared-memory buffers are transformed into resized RGBA thumbnails and cached by window identifier.

  3. 03

    Publish

    Thumbnail data is attached to launcher search results. Updated results can be published asynchronously through the plugin protocol.

  4. 04

    Render and refresh

    The Rust/Iced Alt-Tab interface loads image handles and requests one refresh pass when the switcher opens.

Engineering decisions

The difficult parts were in the handoffs.

Refresh without title changes

Window content can change while its title stays the same. Request::Refresh and PluginResponse::Update make content refresh explicit rather than dependent on title notifications.

Avoid continuous capture

Refreshing once per Alt-Tab opening updates previews without capturing windows continuously while the switcher is visible.

Keep a stable UI

Loading placeholders, cache invalidation and closed-window cleanup account for screenshots arriving asynchronously or becoming obsolete.

Two repositories, one behavior

pop-os/launcher · #291

Screencopy, SHM-to-RGBA conversion, per-window caching and protocol extensions for explicit request/response updates.

pop-os/cosmic-launcher · #435

Thumbnail model and provider, Iced image handles, Alt-Tab presentation, invalidation and a single refresh per opening.

Validation

Tested against changing windows.

The test scenarios below are documented in the upstream pull request descriptions.

  • Real thumbnail rendering in Alt-Tab
  • COSMIC Term content updates without title changes
  • Terminal resizing and COSMIC Files scrolling
  • Dynamic Spotify lyrics and browser/tab changes
  • Companion branches installed and tested together

The PRs document formatting, compilation and test commands in each workspace. This page does not claim an upstream merge or production rollout.

Review and source

Follow the actual implementation.

Both PRs are publicly reviewable. Their descriptions contain the change lists, test commands and observed behaviors. A real screen recording may be added here later; the architecture above intentionally makes no claim to be a capture.