layout: Make rendering not Window-specific

Doesn't need to be any more.
This commit is contained in:
Ivan Molodetskikh 2024-02-04 21:23:00 +04:00
parent 72c8f569ac
commit 7a4bb8ba8a
2 changed files with 23 additions and 26 deletions

View File

@ -7,7 +7,6 @@ use smithay::backend::renderer::element::utils::{
CropRenderElement, Relocate, RelocateRenderElement,
};
use smithay::backend::renderer::{ImportAll, Renderer};
use smithay::desktop::Window;
use smithay::output::Output;
use smithay::utils::{Logical, Point, Rectangle, Scale};
@ -578,9 +577,7 @@ impl<W: LayoutElement> Monitor<W> {
let ws = &self.workspaces[self.active_workspace_idx];
ws.render_above_top_layer()
}
}
impl Monitor<Window> {
pub fn render_elements<R: Renderer + ImportAll>(
&self,
renderer: &mut R,

View File

@ -1058,29 +1058,6 @@ impl<W: LayoutElement> Workspace<W> {
self.columns[self.active_column_idx].is_fullscreen
}
}
impl Workspace<Window> {
pub fn refresh(&self, is_active: bool) {
let bounds = self.toplevel_bounds();
for (col_idx, col) in self.columns.iter().enumerate() {
for (tile_idx, tile) in col.tiles.iter().enumerate() {
let win = tile.window();
let active = is_active
&& self.active_column_idx == col_idx
&& col.active_tile_idx == tile_idx;
win.set_activated(active);
win.toplevel().with_pending_state(|state| {
state.bounds = Some(bounds);
});
win.toplevel().send_pending_configure();
win.refresh();
}
}
}
pub fn render_elements<R: Renderer + ImportAll>(
&self,
@ -1137,6 +1114,29 @@ impl Workspace<Window> {
}
}
impl Workspace<Window> {
pub fn refresh(&self, is_active: bool) {
let bounds = self.toplevel_bounds();
for (col_idx, col) in self.columns.iter().enumerate() {
for (tile_idx, tile) in col.tiles.iter().enumerate() {
let win = tile.window();
let active = is_active
&& self.active_column_idx == col_idx
&& col.active_tile_idx == tile_idx;
win.set_activated(active);
win.toplevel().with_pending_state(|state| {
state.bounds = Some(bounds);
});
win.toplevel().send_pending_configure();
win.refresh();
}
}
}
}
impl<W: LayoutElement> Column<W> {
fn new(
window: W,