From e4d9484d0e1ebcf496d0606800560c09d2753df4 Mon Sep 17 00:00:00 2001 From: tcmal Date: Tue, 13 Aug 2024 17:56:39 +0100 Subject: Add moving and resizing with mouse --- src/helpers.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/helpers.rs') diff --git a/src/helpers.rs b/src/helpers.rs index cc76e43..175eea9 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -82,3 +82,17 @@ pub fn set_tag(wm: &mut WM<'_>, tag: Tag) { wm.clients.set_client_tag(&wm.conn, pos, tag); } } + +/// Move the currently focused window with the mouse +pub fn mouse_move(wm: &mut WM<'_>) { + if let Err(e) = wm.mouse_move() { + println!("error when moving with mouse: {:?}", e); + } +} + +/// Resize the currently focused window with the mouse +pub fn mouse_resize(wm: &mut WM<'_>) { + if let Err(e) = wm.mouse_resize() { + println!("error when resizing with mouse: {:?}", e); + } +} -- cgit v1.2.3