Merge branch 'main' of https://git.site.latha.org/experiments/moon-plasma
CI / test (push) Successful in 39s

This commit is contained in:
nandi committed 2026-11-24 20:21:54 -08:00
commit 49e91b4c01
5 files changed
+305 -45

No files matched your search

+27
View File
@@ -119,3 +119,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)
}