diff --git a/config.ron b/config.ron index 1903387f..5a28839b 100644 --- a/config.ron +++ b/config.ron @@ -53,4 +53,5 @@ (modifiers: [], key: "XF86MonBrightnessDown"): Spawn("busctl --user call com.system76.CosmicSettingsDaemon /com/system76/CosmicSettingsDaemon com.system76.CosmicSettingsDaemon DecreaseDisplayBrightness"), }, workspace_mode: OutputBound, + floating_default: false, ) diff --git a/src/config/mod.rs b/src/config/mod.rs index ac506261..db17fe51 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -34,6 +34,7 @@ pub struct Config { pub struct StaticConfig { pub key_bindings: HashMap, pub workspace_mode: WorkspaceMode, + pub floating_default: bool, } #[derive(Debug, Deserialize, Clone, Copy, PartialEq, Eq)] @@ -216,6 +217,7 @@ impl Config { StaticConfig { key_bindings: HashMap::new(), workspace_mode: WorkspaceMode::Global, + floating_default: false, } } diff --git a/src/shell/mod.rs b/src/shell/mod.rs index 89785fdf..05d16b9d 100644 --- a/src/shell/mod.rs +++ b/src/shell/mod.rs @@ -47,7 +47,7 @@ pub struct Shell { pub outputs: Vec, pub workspace_mode: WorkspaceMode, pub shell_mode: ShellMode, - + pub floating_default: bool, pub pending_windows: Vec<(Window, Seat)>, pub pending_layers: Vec<(LayerSurface, Output, Seat)>, @@ -120,12 +120,14 @@ impl Shell { &mut workspace_state, &mut spaces, ); + let floating_default = config.static_conf.floating_default; Shell { popups: PopupManager::new(None), spaces, outputs: Vec::new(), workspace_mode: mode, + floating_default, shell_mode: ShellMode::Normal, pending_windows: Vec::new(), @@ -592,7 +594,7 @@ impl Shell { .toplevel_enter_workspace(&window, &workspace.handle); self.toplevel_info_state .toplevel_enter_output(&window, &output); - if layout::should_be_floating(&window) { + if layout::should_be_floating(&window) || self.floating_default { workspace .floating_layer .map_window(&mut workspace.space, window, &seat, None);