Skip to content

Forward workspace filter to external plugins and fix search scheduling#290

Open
erik-balfe wants to merge 3 commits into
pop-os:masterfrom
erik-balfe:feature/workspace-filtered-window-search
Open

Forward workspace filter to external plugins and fix search scheduling#290
erik-balfe wants to merge 3 commits into
pop-os:masterfrom
erik-balfe:feature/workspace-filtered-window-search

Conversation

@erik-balfe

@erik-balfe erik-balfe commented Jun 7, 2026

Copy link
Copy Markdown

Summary

Adds workspace-scoped window filtering for the COSMIC window switcher via WorkspaceFilter / Request::SearchFiltered.

Key fixes (tested locally on COSMIC)

  • Super launcher app search restored (ExternalPlugin maps WorkspaceFilter::AllRequest::Search)
  • All subprocess plugins accept SearchFiltered
  • cosmic_toplevel refreshes on workspace change and defers search until metadata is ready

Stacked PR: pop-os/cosmic-launcher#432

Testing

  • IPC: Search("fire") returns filtered apps
  • Super launcher typing filters the list
  • alt-tab-workspace / alt-tab-all work as expected

Checklist

  • AI-assisted; reviewed locally with CodeRabbit CLI + manual testing

ExternalPlugin::search() always sent plain Request::Search, so
cosmic_toplevel never received SearchFiltered(Current). Pass
WorkspaceFilter through the service Plugin trait and forward
SearchFiltered to external plugin processes.

pop_shell ignored SearchFiltered and never finished on COSMIC, which
blocked subsequent window-switcher queries; handle SearchFiltered like
Search, return false from reload on D-Bus or deserialization errors,
and deactivate when PopShell is unavailable. Teach cosmic_toplevel to
match windows by workspace coordinates, defer Current searches until
active workspace metadata is known, and add unit tests for the filter.

Only emit SearchFiltered to plugins when the filter is Current; keep
plain Search for WorkspaceFilter::All so non-window plugins still finish
normal launcher queries.

Assisted by an AI coding agent; changes were reviewed, tested on COSMIC
with multiple workspaces, and validated with CodeRabbit CLI review.
ExternalPlugin always forwarded SearchFiltered to subprocess plugins,
but legacy plugins such as desktop_entries only handled Search. That
left Super launcher typing with a frozen list while cosmic_toplevel
window search still worked.

Send Request::Search when the filter is All to match the service's
plugin_request logic, and teach desktop_entries to accept
SearchFiltered as a belt-and-suspenders fallback.
@erik-balfe erik-balfe force-pushed the feature/workspace-filtered-window-search branch from 9193a30 to caf234b Compare June 10, 2026 11:34
Gate plugin Append/Finished responses so only active searches or an
explicit Clear refresh can populate results. Deduplicate windows in the
service sort path.

cosmic_toplevel now refreshes Current-filtered lists when workspace
coordinates change (user switched workspace with switcher open), sends
Clear before refresh appends, and handles Interrupt.

Assisted by an AI coding agent; changes were reviewed and tested.
@erik-balfe erik-balfe force-pushed the feature/workspace-filtered-window-search branch from caf234b to 53e03ad Compare June 10, 2026 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant