Drag the divider between tiled windows to resize them
CI / test (push) Successful in 37s

- lib/wm: split handles, drag_split, vertical rows now leave room for the lower
  window's title bar (fixes overlapping title bars)
- compositor: pointer press/move/release on a divider resizes the split, with an
  ew/ns-resize cursor; button releases are only forwarded after a forwarded press

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
nandiandClaude Sonnet 5.5 committed 2026-11-24 20:12:13 -08:00
1 parent ee698c9846
commit 7154312919
4 files changed
+290 -32

No files matched your search

+27
View File
@@ -113,3 +113,30 @@ test "host input reaches the focused client and the launcher popup opens" {
assert_false(comp.shell.popup_open())
comp.close()
}
///|
test "dragging the divider between two tiled windows resizes them" {
let socket_path = "/tmp/wayland-moon-split-" +
@sys.getpid().to_string() +
".sock"
let theme = @scene.ThemeTokens::moon_night()
let comp = @host.MoonPlasmaCompositor::new(socket_path, theme, 1280, 720).unwrap()
let _a = open_and_configure_client(comp, socket_path, "A", "a")
let _b = open_and_configure_client(comp, socket_path, "B", "b")
let left = comp.windows.get(1UL).unwrap().geometry
let right = comp.windows.get(2UL).unwrap().geometry
// The divider is the gap between the two windows.
let gx = left.x + left.w + 2
let gy = left.y + left.h / 2
assert_true(right.x > left.x + left.w)
comp.handle_input(@nested.InputEvent::PointerMove(gx.to_double(), gy.to_double()), 1U)
assert_eq(comp.desired_cursor(), 26U) // ew-resize over the divider
comp.handle_input(@nested.InputEvent::PointerButton(272U, true), 2U)
comp.handle_input(@nested.InputEvent::PointerMove(400.0, gy.to_double()), 3U)
comp.handle_input(@nested.InputEvent::PointerButton(272U, false), 4U)
let left2 = comp.windows.get(1UL).unwrap().geometry
let right2 = comp.windows.get(2UL).unwrap().geometry
assert_true(left2.w < left.w - 200)
assert_true(right2.w > right.w + 200)
assert_true(right2.x > left2.x + left2.w)
}