Galaxy Shell / docs
Docs / Histórico

Investigation: Flutter, WM and compositor

openspec/changes/archive/2026-10-26-compositor-investigation/design.md · Editar no GitHub ↗

Esta página ainda não tem tradução em português. O conteúdo abaixo está em inglês.

Este documento registra decisões, planejamento ou evidências de uma etapa do projeto. Não implica que todos os itens estejam implementados ou validados na versão atual.

Nesta página

Investigation: Flutter, WM and compositor

Doc status: history. Flutter and Mutter investigation, superseded by the Smithay and web direction in AGENTS.md. Checked 2026-11-10.

Review of documentation and upstream code on 2026-10-26. No installation, implementation or runtime validation. Complements the concept.

Conclusion

Flutter as a compositor client is a viable architecture in principle. The management policy can live in Dart, but the authority over composition and over applying operations must sit in the compositor. There is no need to implement anything to find this separation.

A dedicated session on top of libmutter has a concrete precedent in GNOME Kiosk. This proves the integration mechanism. It does not prove the compatibility of a Flutter bridge that does not exist yet. The contracts examined did not reveal a ready-made service that exposes all of this control to an external Flutter application.

Evidence and responsibilities

Need Evidence Implication
Dedicated session without GNOME Shell GNOME Kiosk creates a MetaContext, registers its MetaPlugin, and runs setup/start/main loop We can use libmutter without building a compositor from scratch. This approach requires a native component
Grid and focus MetaWindow exposes move_resize_frame, activate, get_frame_rect and the signals position-changed/size-changed/unmanaged Dart can compute the grid. The bridge applies operations and publishes the observed state
Animation of real windows MetaWindowActor inherits from ClutterActor; MetaPlugin receives map/minimize/destroy/size_change/switch_workspace Window effects are implemented in the compositor scene. Flutter can request effects without rendering the windows
Perspective and effects ClutterActor exposes per-axis rotation, scale, transformation, transitions and effects There are tools for composition with 3D transformations. This does not prove a complete 3D engine or every desired effect
Sharing MetaWindow belongs to one workspace or to all of them Shared environments need their own model. They are not automatically equivalent to native workspaces
Manual control There are focus and grab-op-begin signals, plus geometry events The manual takeover policy must tell human interaction apart from programmatic changes. Focus alone does not prove a manual takeover

Proposed bridge, not yet implemented

A native process hosts libmutter and the plugin. Flutter remains the graphical client. Dart can keep environments and the grid policy in a separate process. Authenticated local IPC, for example a Unix socket or D-Bus with authorization, would carry commands and events.

The contract must use window IDs that are valid within the session, state version, applied geometry, capabilities and errors. It must tell a resize request apart from the Wayland client's confirmation. It must respect application restrictions, dialogs and fullscreen. Effects must run on the compositor clock, without sending every frame from Dart.

The IPC choice is an architectural proposal, not a ready-made Mutter API. A small bridge to list, focus and move does not mean the full shell is small: the session lifecycle, shortcuts, dialogs, recovery and additional policies require work.

Maintenance

The documentation consulted is for API 51. GNOME Kiosk pins mutter_api_version = 51 and also depends on the versioned Clutter and Cogl libraries. This is evidence of coupling to the Mutter series. It does not allow assuming a stable ABI across series. We need to pin a target version and evaluate updates. No full comparison of the APIs between releases was made.

MetaPlugin requires notifications when effects complete, and it requires handling of cancellation. An incomplete integration can leave states stuck. Do not treat animation as appearance only.

River as an alternative

River separates the compositor and the WM through river-window-management-v1, with external policy for size, position, focus and shell surfaces. The project declares this protocol stable. The contract has manage/render sequences to synchronize state and presentation.

This offers a more explicit boundary for a separate WM. However, no ready Dart binding was shown, and no automatic integration of the Flutter runner with special protocol surfaces was shown. Do not present the protocol examined as a generic API for shaders or 3D transformation of application textures. That capability would need additional evaluation of the compositor.

Flutter as an internal part of the compositor

The embedder API allows hosting the Flutter engine, but it does not implement the Wayland server infrastructure by itself. Embedding the engine in the Mutter scene would require integrating render targets, graphics synchronization, input and lifecycle. No ready official Flutter/Mutter integration was found in the sources examined. So this is an alternative that needs more work, not a requirement for the product.

Recommendation

Keep Flutter for the interface, Dart for the domain and policies, and Mutter as the first native candidate, as the current concept states. The documentation supports starting this design without an exploratory prototype. Choose River if the dominant goal becomes a stable external boundary for the WM. Do not choose it only by assuming equivalent support for effects.

These items remain for practical validation: Flutter client compatibility in the chosen session, resize and animation synchronization, recovery after failure, input and accessibility, graphics consumption, monitors and scale. None of these results has been declared ready.

Primary sources

Context was consulted. No Mutter/River package was installed. The conclusions use official documentation and code. main URLs are moving targets. This record describes the consultation of this date, not a dependency lock.