Diff
diff --cc src/window_manager.rs
index 8c5a0de,27ca7e2..beb16a1
--- a/src/window_manager.rs
+++ b/src/window_manager.rs
@@@ -315,25 -316,7 +316,25 @@@ impl WindowManager
}
}
- fn toggle_floating(&mut self) -> Result<()> {
++ fn toggle_floating(&mut self) -> WmResult<()> {
+ if let Some(focused) = self.focused_window {
+ if self.floating_windows.contains(&focused) {
+ self.floating_windows.remove(&focused);
+ self.apply_layout()?;
+ } else {
+ self.floating_windows.insert(focused);
+ self.connection.configure_window(
+ focused,
+ &ConfigureWindowAux::new().stack_mode(StackMode::ABOVE),
+ )?;
+ self.apply_layout()?;
+ self.connection.flush()?;
+ }
+ }
+ Ok(())
+ }
+
- fn toggle_fullscreen(&mut self) -> Result<()> {
+ fn toggle_fullscreen(&mut self) -> WmResult<()> {
if let Some(focused) = self.focused_window {
if self.fullscreen_window == Some(focused) {
self.fullscreen_window = None;