mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-05-07 03:13:31 +02:00
feat(wm): toggle float override with floating layer
This commit ensures that a workspace float override will also be applied when the user switches to the floating layer, and removed when the user switches to the tiling layer. This results in a workflow which makes it easier to spawn floating windows on the fly.
This commit is contained in:
@@ -88,7 +88,7 @@ pub struct Workspace {
|
||||
pub float_override: Option<bool>,
|
||||
#[getset(get = "pub", get_mut = "pub", set = "pub")]
|
||||
pub globals: WorkspaceGlobals,
|
||||
#[getset(get = "pub", get_mut = "pub", set = "pub")]
|
||||
#[getset(get = "pub", get_mut = "pub")]
|
||||
pub layer: WorkspaceLayer,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
#[getset(get = "pub", set = "pub")]
|
||||
@@ -593,6 +593,19 @@ impl Workspace {
|
||||
Ok((hwnds.len() + floating_hwnds.len(), container_ids.len()))
|
||||
}
|
||||
|
||||
pub fn set_layer(&mut self, layer: WorkspaceLayer) {
|
||||
self.layer = layer;
|
||||
|
||||
match layer {
|
||||
WorkspaceLayer::Tiling => {
|
||||
self.float_override = None;
|
||||
}
|
||||
WorkspaceLayer::Floating => {
|
||||
self.float_override = Some(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn container_for_window(&self, hwnd: isize) -> Option<&Container> {
|
||||
self.containers().get(self.container_idx_for_window(hwnd)?)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user