mirror of
https://github.com/YaLTeR/niri.git
synced 2024-09-20 16:58:36 +03:00
layout: Make rendering not Window-specific
Doesn't need to be any more.
This commit is contained in:
parent
72c8f569ac
commit
7a4bb8ba8a
@ -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,
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user