Module window

Module window 

Source

Functions§

apply_window_opacity 🔒
Apply window-level opacity via WS_EX_LAYERED + SetLayeredWindowAttributes. This makes the entire window semi-transparent (content + chrome).
capture_hwnd_for_label 🔒
Capture and store the HWND for label in AppState::window_hwnds.
close_window
Close the window. Args: optional { "label": string }; defaults to “main”. (Linux/macOS need the label to act on the right window when called from a non-main window. Windows resolves per-process via find_own_top_level_window.)
close_window_by_label
Close a specific window by label. Used by the tear-off Phase 4 merge path: after the candidate window pulls the dragged tab into its own workspace via MoveTabToWorkspace, the dragged window is empty and should be destroyed. Posts WM_CLOSE on Win32; uses the existing UI-thread close task on other platforms.
find_all_own_windows 🔒
Find ALL visible top-level windows belonging to this process.
find_own_top_level_window 🔒
Find the top-level window belonging to this process. In CEF Views mode, browser.host().window_handle() returns NULL, so we enumerate windows and find ours by process ID.
focus_window
Focus a specific window by label.
get_double_click_time
Return the OS double-click interval in milliseconds. On Windows: GetDoubleClickTime() — typically 500ms, user-configurable via Mouse settings. On non-Windows: hardcoded 500ms (the Win32 default, also a common cross-platform default; Phase 7 can refine per platform).
get_instance_number
Get the instance number for the current window.
get_offset_position 🔒
Get an offset position for a new window: 30px right and 30px down from the current window.
get_secondary_window_size 🔒
Compute 70% of the monitor’s work area for a secondary window at (px, py). Falls back to 1200x800 if the monitor can’t be determined.
get_window_label
Get the current window label. The frontend passes its own label (extracted from URL params) as an arg.
get_window_opacity
Return the currently tracked opacity for a label.
get_window_position
Get the current window position on screen.
get_zoom_factor
Get the current zoom factor.
is_main_window
Check if this is the main window. The frontend passes its own label (extracted from URL params) as an arg.
list_window_instances
List all open window instances with their backend window IDs. Same filtering as list_windows (excludes unpromoted pool windows and browser-pane child HWNDs), but returns [{label, windowId}] pairs so the frontend can resolve per-window backend objects (Window record → meta[“window:displayname”], etc.) without an extra round-trip per row.
list_windows
List all open window labels, excluding unpromoted pool windows. Pool windows are pre-warmed tear-off scratch windows kept hidden from the user (WS_EX_TOOLWINDOW, no taskbar entry). Including them in list_windows inflates the frontend’s InstancePanel row count with phantom entries the user can’t see or focus.
maximize_window
Maximize/unmaximize the window (toggle).
minimize_window
Minimize the window. Args: optional { "label": string }; defaults to “main”.
move_window_by
Move the window by a delta (dx, dy) from its current position.
open_new_window
Open a new full AgentMux instance (status-bar version click, Ctrl+Shift+N, second agentmux.exe launch). Independent top-level window, own taskbar entry, independent lifecycle. See docs/specs/SPEC_MULTIWINDOW_TASKBAR_GROUPING.md.
open_subwindow
Open a sub-window tied to parent_instance_id. Not exposed to users — reserved for agent / backend callers that need a transient auxiliary top-level window (tool-spawned panels, diff views, etc.). Sub-windows are hidden from the taskbar via ITaskbarList::DeleteTab and close when their parent full instance closes.
open_window_with_kind 🔒
register_backend_window
Register the backend window ID for a window label. Called by the frontend after it has initialized its backend Window object. Used by on_before_close to notify the backend when a secondary window closes.
remove_window_opacity 🔒
Remove window opacity — restore to fully opaque by removing WS_EX_LAYERED.
resolve_frontend_base_url 🔒
Resolve the base URL for the frontend. Production: IPC server serves static files from frontend/ next to the exe. Dev: Vite dev server at http://localhost:5173.
set_window_opacity
Set opacity on exactly one window by label.
set_window_position
Move the window to an absolute screen position (x, y). Each call is self-contained — no read-modify-write — so concurrent in-flight calls are idempotent: the last write wins, which is exactly correct for drag.
set_window_transparency
Set window transparency/blur effects for a single window.
set_zoom_factor
Set the zoom factor. CEF zoom uses a logarithmic scale: zoom_level = log2(zoom_factor) So factor 1.0 = level 0, factor 2.0 = level 1, factor 0.5 = level -1
start_window_drag
Initiate window drag (for frameless windows). Windows: sends WM_NCLBUTTONDOWN/HTCAPTION via Win32 — find_own_top_level_window resolves the per-process HWND so multi-window works without a label. Linux/macOS: dispatches CefWindow::BeginWindowDrag on the UI thread; needs the source window’s label so non-main windows drag themselves rather than the main window. Frontend reads ?windowLabel=… from its URL and passes it here; missing → “main” for backward compatibility.
toggle_devtools
Toggle DevTools for the main window.