summaryrefslogtreecommitdiff
path: root/src/helpers.rs
diff options
context:
space:
mode:
authortcmal <me@aria.rip>2024-08-13 17:56:39 +0100
committertcmal <me@aria.rip>2024-08-13 21:48:11 +0100
commite4d9484d0e1ebcf496d0606800560c09d2753df4 (patch)
tree23931a1cba89ca75e592c7351022bf7b22c487a8 /src/helpers.rs
parentd973959f7f34e02eeb01766b01aff680639a8c4c (diff)
Add moving and resizing with mouse
Diffstat (limited to 'src/helpers.rs')
-rw-r--r--src/helpers.rs14
1 files changed, 14 insertions, 0 deletions
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);
+ }
+}