Files
chandra/interface/moonplasma/desktop/windows/top.mbt
T
nandiandClaude Sonnet 5.5 70ad87f2d2
CI / test (push) Failing after 18s
Task manager panel module and Alt+Tab window switcher
- components/tasks: the 'tasks' module the panel and components.txt already named but whose source
  was missing. One pill per window in opening order (stable, not stacking order), focused lit,
  minimized dimmed, hover, titles shortened, pills shrink to fit; click focuses/restores.
  Tests that loaded it (task list, title-bar minimize/restore) pass again.
- compositor/host/switcher.mbt: hold Alt, press Tab: most-recently-used window list with the
  previous window selected; Tab/Shift+Tab/arrows move, releasing Alt switches (restoring a
  minimized window), Escape cancels. Tab is not forwarded to clients.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-25 03:39:19 -08:00

68 lines
2.3 KiB
MoonBit

// Generated by `wit-bindgen` 0.63.0. DO NOT EDIT!
///|
pub(all) struct WindowInfo {
id : UInt; title : String; focused : UInt; minimized : UInt
}
///|
/// Richer, id-stable view for widgets that show more than a task bar (the Pulse widget).
pub(all) struct WindowDetail {
id : UInt64; title : String; app_id : String; focused : Bool
}
///|
pub fn list_windows() -> Array[WindowInfo] {
let return_area = mbt_ffi_malloc(8)
wasmImportListWindows(return_area);
let array : Array[WindowInfo] = [];
for index = 0; index < (mbt_ffi_load32((return_area) + 4)); index = index + 1 {
let iter_base = (mbt_ffi_load32((return_area) + 0)) + (index * 20)
let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8))
array.push(WindowInfo::{id : (mbt_ffi_load32((iter_base) + 0)).reinterpret_as_uint(), title : result, focused : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint(), minimized : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()})
}
mbt_ffi_free(mbt_ffi_load32((return_area) + 0))
let ret = array
mbt_ffi_free(return_area)
return ret
}
///|
/// Focus, raise (and un-minimize) a window.
pub fn focus_window(id : UInt) -> Unit {
wasmImportFocusWindow((id).reinterpret_as_int());
}
///|
pub fn all() -> Array[WindowDetail] {
let return_area = mbt_ffi_malloc(8)
wasmImportAll(return_area);
let array : Array[WindowDetail] = [];
for index = 0; index < (mbt_ffi_load32((return_area) + 4)); index = index + 1 {
let iter_base = (mbt_ffi_load32((return_area) + 0)) + (index * 32)
let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))
let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20))
array.push(WindowDetail::{id : (mbt_ffi_load64((iter_base) + 0)).reinterpret_as_uint64(), title : result, app_id : result0, focused : (mbt_ffi_load8_u((iter_base) + 24) != 0)})
}
mbt_ffi_free(mbt_ffi_load32((return_area) + 0))
let ret = array
mbt_ffi_free(return_area)
return ret
}
///|
/// Raise and focus a window (restoring it if minimized).
pub fn focus(id : UInt64) -> Unit {
wasmImportFocus((id).reinterpret_as_int64());
}