summaryrefslogtreecommitdiff
path: root/src/helpers.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/helpers.rs')
-rw-r--r--src/helpers.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/helpers.rs b/src/helpers.rs
index 51ebae8..b7488dd 100644
--- a/src/helpers.rs
+++ b/src/helpers.rs
@@ -40,3 +40,10 @@ pub fn focus_next(wm: &mut WM<'_>) {
pub fn focus_prev(wm: &mut WM<'_>) {
wm.clients.change_focus(&wm.conn, false);
}
+
+/// Toggle floating status for the currently focused window
+pub fn toggle_floating(wm: &mut WM<'_>) {
+ if let Some(pos) = wm.clients.focused_pos() {
+ wm.clients.toggle_floating(&wm.conn, pos);
+ }
+}