feat: honor layer shell exclusive zones
This commit is contained in:
1 parent
f2ef8de74f
commit
d822920d59
1 file changed
+24
-1
+24
-1
@@ -361,9 +361,11 @@ impl Ferese {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn relayout(&mut self) {
|
pub fn relayout(&mut self) {
|
||||||
|
self.arrange_layers();
|
||||||
let Some(bounds) = self.output_bounds() else {
|
let Some(bounds) = self.output_bounds() else {
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
let fullscreen_bounds = self.full_output_bounds().unwrap_or(bounds);
|
||||||
let layout = match self.tiled_layout(bounds) {
|
let layout = match self.tiled_layout(bounds) {
|
||||||
Ok(layout) => layout,
|
Ok(layout) => layout,
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
@@ -410,7 +412,7 @@ impl Ferese {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let rect = if fullscreen == Some(*id) {
|
let rect = if fullscreen == Some(*id) {
|
||||||
bounds
|
fullscreen_bounds
|
||||||
} else if fullscreen.is_some() {
|
} else if fullscreen.is_some() {
|
||||||
return None;
|
return None;
|
||||||
} else {
|
} else {
|
||||||
@@ -772,6 +774,19 @@ impl Ferese {
|
|||||||
fn output_bounds(&self) -> Option<Rect> {
|
fn output_bounds(&self) -> Option<Rect> {
|
||||||
let output = self.space.outputs().next()?;
|
let output = self.space.outputs().next()?;
|
||||||
let geometry = self.space.output_geometry(output)?;
|
let geometry = self.space.output_geometry(output)?;
|
||||||
|
let zone = layer_map_for_output(output).non_exclusive_zone();
|
||||||
|
|
||||||
|
Some(Rect::new(
|
||||||
|
(geometry.loc.x + zone.loc.x) as f64,
|
||||||
|
(geometry.loc.y + zone.loc.y) as f64,
|
||||||
|
zone.size.w.max(0) as f64,
|
||||||
|
zone.size.h.max(0) as f64,
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn full_output_bounds(&self) -> Option<Rect> {
|
||||||
|
let output = self.space.outputs().next()?;
|
||||||
|
let geometry = self.space.output_geometry(output)?;
|
||||||
|
|
||||||
Some(Rect::new(
|
Some(Rect::new(
|
||||||
geometry.loc.x as f64,
|
geometry.loc.x as f64,
|
||||||
@@ -781,6 +796,14 @@ impl Ferese {
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn arrange_layers(&self) {
|
||||||
|
let outputs = self.space.outputs().cloned().collect::<Vec<_>>();
|
||||||
|
|
||||||
|
for output in outputs {
|
||||||
|
layer_map_for_output(&output).arrange();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn logical_window_rect(&self, window: WindowId, bounds: Rect) -> Option<Rect> {
|
fn logical_window_rect(&self, window: WindowId, bounds: Rect) -> Option<Rect> {
|
||||||
let workspace = self.workspaces.workspace_for_window(window)?;
|
let workspace = self.workspaces.workspace_for_window(window)?;
|
||||||
let workspace = self.workspaces.workspace(workspace)?;
|
let workspace = self.workspaces.workspace(workspace)?;
|
||||||
|
|||||||
Reference in new issue
Block a user