Files
chandra/compositor/host/resize_test.mbt
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

17 lines
741 B
MoonBit

///| Resizing the output (the nested window was resized): the desktop is drawn at the new size.
///|
test "resize redraws the desktop at the new output size" {
let socket_path = "/tmp/wayland-moon-resize-" + @sys.getpid().to_string() + ".sock"
let comp = @host.MoonPlasmaCompositor::new(socket_path, @scene.ThemeTokens::moon_night(), 1280, 720).unwrap()
let before = comp.compose_frame()
assert_eq((before.width, before.height), (1280, 720))
comp.resize(900, 560)
let after = comp.compose_frame()
assert_eq((after.width, after.height), (900, 560))
assert_eq((comp.output_w, comp.output_h), (900, 560))
assert_eq(comp.work_area.h, 560 - 32 - comp.theme.panel_height)
assert_eq(comp.server.output_w, 900)
comp.close()
}