Files
chandra/lib/wm/pkg.generated.mbti
T
Claude 7248e0ca6e Nested window: follow the host's size instead of being cropped
The --window backend pinned its xdg_toplevel to a fixed size (min == max ==
1280x720 or --size) and ignored xdg_toplevel.configure. Whenever the host gave
the window less room than that (a tiling host, a maximized/snapped window, a
screen smaller than the default once its own panels and title bar are taken
off), the host cropped the 1280x720 buffer and the right/bottom of the desktop,
panel included, was cut off. Fullscreen only looked right when the screen
happened to be at least that big.

- nested: drop the max size (min 640x400), read the configure size and, on
  xdg_wm_base v4, configure_bounds to fit the first size on screen; report a
  new size through take_resize.
- compositor: MoonPlasmaCompositor::resize recomputes the work area, tells
  clients the new wl_output mode, reflows every workspace and pulls floating
  windows back inside (WmState::fit_work_area), and forces a full redraw.
- both main loops (wasm component and native) resize before presenting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hkYa7dkDnotDeMSdX7
2026-11-25 17:07:33 +00:00

172 lines
4.0 KiB
Plaintext

// Generated using `moon info`, DON'T EDIT IT
package "moonplasma/desktop/lib/wm"
import {
"moonbitlang/core/debug",
}
// Values
pub fn clamp_int(Int32, Int32, Int32) -> Int32
pub fn compute_bsp_rects(BspNode, Rect, Int32, vgap? : Int32) -> Array[(UInt64, Rect)]
pub fn compute_split_handles(BspNode, Rect, Int32, Int32) -> Array[SplitHandle]
pub fn compute_work_area(Rect, excl_top? : Int32, excl_right? : Int32, excl_bottom? : Int32, excl_left? : Int32) -> Rect
pub fn insert_leaf(BspNode?, UInt64, horizontal? : Bool) -> BspNode
pub fn remove_leaf(BspNode?, UInt64) -> BspNode?
// Errors
// Types and methods
#derive(Eq, Show, @debug.Debug)
pub(all) enum BspNode {
Leaf(UInt64)
Split(horizontal~ : Bool, ratio~ : Double, left~ : BspNode, right~ : BspNode)
}
#derive(Eq, Show)
pub(all) enum DragMode {
Move
ResizeN
ResizeS
ResizeE
ResizeW
ResizeNW
ResizeNE
ResizeSW
ResizeSE
}
pub(all) struct DragSession {
win_id : UInt64
mode : DragMode
start_ptr_x : Int32
start_ptr_y : Int32
start_rect : Rect
}
#derive(Eq, Show, @debug.Debug)
pub(all) enum InputHit {
Client(UInt64, Int32, Int32)
Decoration(UInt64, Int32, Int32)
ShellPanel(Int32, Int32)
HitNone
}
#derive(Eq, Show, @debug.Debug)
pub(all) enum LayoutMode {
Floating
Tiling
Monocle
}
#derive(Eq, Show, @debug.Debug)
pub(all) struct Rect {
x : Int32
y : Int32
w : Int32
h : Int32
}
pub fn Rect::contains(Self, Int32, Int32) -> Bool
#derive(Eq, Show, @debug.Debug)
pub(all) struct Size {
w : Int32
h : Int32
}
pub(all) struct SplitHandle {
path : Array[Bool]
horizontal : Bool
rect : Rect
area : Rect
}
pub(all) struct WindowRecord {
id : UInt64
app_id : String
title : String
mut geometry : Rect
mut floating_geometry : Rect
min_size : Size
max_size : Size?
mut focused : Bool
mut maximized : Bool
mut fullscreen : Bool
mut minimized : Bool
mut is_floating : Bool
workspace : UInt32
can_move : Bool
can_resize : Bool
can_maximize : Bool
can_minimize : Bool
can_fullscreen : Bool
}
#derive(Eq, Show, @debug.Debug)
pub(all) enum WindowRequest {
Maximize(Bool)
Fullscreen(Bool)
Minimize(Bool)
Close
Activate
MoveTo(Int32, Int32)
ResizeTo(Int32, Int32)
}
#derive(Eq, Show, @debug.Debug)
pub(all) enum WmAction {
SetGeometry(UInt64, Rect)
Focus(UInt64)
Raise(UInt64)
Close(UInt64)
SetMaximized(UInt64, Bool)
SetFullscreen(UInt64, Bool)
}
pub(all) struct WmState {
workspaces : Array[Workspace]
windows : Map[UInt64, WindowRecord]
mut active_workspace : UInt32
mut focused : UInt64?
mut inner_gap : Int32
mut outer_gap : Int32
mut titlebar_h : Int32
mut border_w : Int32
mut cascade_step : Int32
mut drag : DragSession?
}
pub fn WmState::close_window(Self, UInt64, Rect) -> Array[WmAction]
pub fn WmState::drag_split(Self, SplitHandle, Int32, Int32, Rect) -> Array[WmAction]
pub fn WmState::end_drag(Self) -> Unit
pub fn WmState::fit_work_area(Self, Rect) -> Array[WmAction]
pub fn WmState::float_window(Self, UInt64, Rect) -> Array[WmAction]
pub fn WmState::handle_request(Self, UInt64, WindowRequest, Rect) -> Array[WmAction]
pub fn WmState::hit_test(Self, Int32, Int32, Rect?) -> InputHit
pub fn WmState::new(inner_gap? : Int32, outer_gap? : Int32, titlebar_h? : Int32, border_w? : Int32) -> Self
pub fn WmState::open_window(Self, WindowRecord, Rect) -> Array[WmAction]
pub fn WmState::relayout(Self, UInt32, Rect) -> Array[WmAction]
pub fn WmState::set_layout_mode(Self, LayoutMode, Rect) -> Array[WmAction]
pub fn WmState::split_handles(Self, Rect) -> Array[SplitHandle]
pub fn WmState::stacking_order(Self) -> Array[UInt64]
pub fn WmState::start_drag(Self, UInt64, DragMode, Int32, Int32) -> Bool
pub fn WmState::sync_windows(Self, Rect, Array[WindowRecord]) -> Array[WmAction]
pub fn WmState::update_drag(Self, Int32, Int32) -> WmAction?
pub(all) struct Workspace {
id : UInt32
mut mode : LayoutMode
mut tree : BspNode?
floating : Array[UInt64]
mru : Array[UInt64]
mut fullscreen : UInt64?
}
pub fn Workspace::new(UInt32, mode? : LayoutMode) -> Self
// Type aliases
// Traits