Module floating_pane

Module floating_pane 

Source
Expand description

Win32-native owned-window creator for floating panes. Phase 1 of issue #810 (floating-pane tear-off).

This module is intentionally Windows-only and intentionally separate from crate::ui_tasks (which posts the standard CEF Views top-level windows). A floating pane is a raw WS_POPUP HWND with WS_EX_TOOLWINDOW, owner = source main window. CEF Views does not expose tool-window / owner semantics in a way that lets us achieve the no-taskbar + minimize-cascade behavior the spec requires, so we drop down to CreateWindowExW and then embed a CEF browser inside the resulting HWND via WindowInfo::set_as_child — the same mechanism the browser-pane creation path uses (browser_pane/creation.rs).

See issue #810 / docs/specs/SPEC_FLOATING_PANE_TEAROFF_2026_05_11.md for the full design and phase plan.

§Scope of Phase 1

  • Register the IPC command (open_floating_pane_window).
  • Allocate a stable window label.
  • Create the owned WS_POPUP | WS_EX_TOOLWINDOW HWND.
  • Embed a CEF browser inside it via WindowInfo::set_as_child.
  • Browser loads <frontend>?floatingPaneId=<id>&windowLabel=<lbl>.

§Out of scope for Phase 1 (per spec §9)

  • Drag-to-tear-off wiring (Phase 3).
  • Floating-pane frontend shell that renders the full <Block> (Phase 2). Phase 1’s stub shell renders only a placeholder so the primitive can be validated end-to-end.
  • Re-dock (Phase 4).
  • Persistence (Phase 5).
  • macOS / Linux ports (deferred).

Structs§

CreateFloatingWindowTask

Functions§

create_owned_popup 🔒
CreateWindowExW wrapper that produces the owned WS_POPUP + WS_EX_TOOLWINDOW HWND used as the floating-pane outer shell.
escape_query_value 🔒
Minimal query-string escaping for the pane id. Encodes the small set of characters that would break query-string parsing. Avoids pulling in a url/urlencoding dependency for a single-call site.
post_create_floating_window
Posts the create-floating-window task to the CEF UI thread. Returns immediately. Mirrors the shape of ui_tasks::post_create_window but goes through this module so the path is grep-able.