Resize floating windows by dragging their corners and side edges
CI / test (push) Failing after 15s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
nandiandClaude Sonnet 5.5 committed 2026-11-25 00:44:34 -08:00
1 parent 8a3ea16b1c
commit a9417fbccf
2 files changed
+117 -21

No files matched your search

+30
View File
@@ -721,3 +721,33 @@ test "dragging a title bar moves the window and floats it" {
// 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)
}