Merge commits a9417fbccf
CI / test (push) Failing after 28s

This commit is contained in:
nandi committed 2026-11-25 01:04:11 -08:00
commit 69a1a0738c
22 files changed
+939 -34

No files matched your search

+54
View File
@@ -763,3 +763,57 @@ test "copy in one client, paste in another" {
assert_true(has_msg(drain_msgs(a), src, 1U))
@sys.close_fd(fd)
}
///|
test "dragging a title bar moves the window and floats it" {
let socket_path = "/tmp/wayland-moon-wdrag-" +
@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 g0 = comp.windows.get(2UL).unwrap().geometry
let sx = g0.x + g0.w / 3
let sy = g0.y - 16 // inside the title bar, clear of the buttons
comp.handle_input(@nested.InputEvent::PointerMove(sx.to_double(), sy.to_double()), 1U)
comp.handle_input(@nested.InputEvent::PointerButton(272U, true), 2U)
comp.handle_input(@nested.InputEvent::PointerMove((sx - 120).to_double(), (sy + 60).to_double()), 3U)
comp.handle_input(@nested.InputEvent::PointerButton(272U, false), 4U)
let g1 = comp.windows.get(2UL).unwrap().geometry
assert_eq(g1.x, g0.x - 120)
assert_eq(g1.y, g0.y + 60)
assert_eq(g1.w, g0.w)
// The other window now has the whole tiling area.
assert_true(comp.windows.get(1UL).unwrap().geometry.w > g0.w)
}
///|
test "dragging a floating window's corner resizes it" {
let socket_path = "/tmp/wayland-moon-rsz-" +
@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")
// Float window 2 by dragging its title bar a little.
let g = comp.windows.get(2UL).unwrap().geometry
comp.handle_input(@nested.InputEvent::PointerMove((g.x + 40).to_double(), (g.y - 16).to_double()), 1U)
comp.handle_input(@nested.InputEvent::PointerButton(272U, true), 2U)
comp.handle_input(@nested.InputEvent::PointerMove((g.x + 40).to_double(), (g.y - 6).to_double()), 3U)
comp.handle_input(@nested.InputEvent::PointerButton(272U, false), 4U)
let g0 = comp.windows.get(2UL).unwrap().geometry
let cx = g0.x + g0.w - 1
let cy = g0.y + g0.h - 1
comp.handle_input(@nested.InputEvent::PointerMove(cx.to_double(), cy.to_double()), 5U)
assert_eq(comp.desired_cursor(), 29U) // nwse-resize on the bottom-right corner
comp.handle_input(@nested.InputEvent::PointerButton(272U, true), 6U)
comp.handle_input(@nested.InputEvent::PointerMove((cx - 50).to_double(), (cy - 40).to_double()), 7U)
comp.handle_input(@nested.InputEvent::PointerButton(272U, false), 8U)
let g1 = comp.windows.get(2UL).unwrap().geometry
assert_eq(g1.x, g0.x)
assert_eq(g1.y, g0.y)
assert_eq(g1.w, g0.w - 50)
assert_eq(g1.h, g0.h - 40)
}