Drag windows by their title bar
CI / test (push) Failing after 17s

A press on a title bar (outside the buttons) focuses the window, floats it if it was
tiled (WmState::float_window) and starts a move drag; motion moves it, release ends it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
nandiandClaude Sonnet 5.5 committed 2026-11-25 00:42:38 -08:00
1 parent f05677178a
commit 8a3ea16b1c
3 files changed
+71 -1

No files matched your search

+23
View File
@@ -880,6 +880,29 @@ pub fn WmState::hit_test(
HitNone
}
///| Take a tiled window out of the tiling tree so it can be moved freely; it keeps its
/// current geometry. No-op for windows that already float.
pub fn WmState::float_window(
self : WmState,
id : UInt64,
work_area : Rect,
) -> Array[WmAction] {
match self.windows.get(id) {
None => []
Some(win) =>
if win.is_floating || win.maximized || win.fullscreen {
[]
} else {
let ws = self.ensure_workspace(win.workspace)
ws.tree = remove_leaf(ws.tree, id)
win.is_floating = true
win.floating_geometry = win.geometry
push_top(ws.floating, id)
self.relayout(win.workspace, work_area)
}
}
}
///|
pub fn WmState::start_drag(
self : WmState,