diff --git a/src/layout.rs b/src/layout.rs index 988c1fd..c80d8b2 100644 --- a/src/layout.rs +++ b/src/layout.rs @@ -1,21 +1,17 @@ // SPDX-License-Identifier: GPL-3.0-or-later -use std::time::Duration; - use itertools::{Either, Itertools}; use smithay::{ desktop::layer_map_for_output, output::Output, - reexports::wayland_server::Resource, utils::{IsAlive, Logical, Point, Rectangle, Size}, - wayland::compositor::{self, CompositorHandler}, }; use crate::{ state::{State, WithState}, window::{ window_state::{FloatingOrTiled, FullscreenOrMaximized, LocationRequestState}, - WindowElement, BLOCKER_COUNTER, + WindowElement, }, }; @@ -161,12 +157,6 @@ impl State { }); } - // BLOCKER_COUNTER.store(1, std::sync::atomic::Ordering::SeqCst); - // tracing::debug!( - // "blocker {}", - // BLOCKER_COUNTER.load(std::sync::atomic::Ordering::SeqCst) - // ); - // Pause rendering. Here we'll wait until all windows have ack'ed and committed, // then resume rendering. This prevents flickering because some windows will commit before // others. @@ -175,15 +165,6 @@ impl State { // anything meaningfully. self.pause_rendering = true; - // for (_loc, win) in pending_wins.iter() { - // if let Some(surf) = win.wl_surface() { - // tracing::debug!("adding blocker"); - // compositor::add_blocker(&surf, crate::window::WindowBlocker); - // } - // } - - let pending_wins_clone = pending_wins.clone(); - // schedule on all idle self.schedule( move |_dt| { @@ -199,62 +180,9 @@ impl State { for (loc, win) in non_pending_wins { dt.state.space.map_element(win, loc, false); } - for win in windows_not_on_foc_tags { - dt.state.space.unmap_elem(&win); - } dt.state.pause_rendering = false; }, ); - - // self.schedule( - // move |_data| { - // // tracing::debug!("Waiting for all to ack"); - // pending_wins_clone.iter().all(|(_, win)| { - // win.with_state(|state| state.loc_request_state.is_acknowledged()) - // }) - // }, - // move |data| { - // // remove and trigger blockers - // BLOCKER_COUNTER.store(0, std::sync::atomic::Ordering::SeqCst); - // tracing::debug!( - // "blocker {}", - // BLOCKER_COUNTER.load(std::sync::atomic::Ordering::SeqCst) - // ); - // for client in pending_wins - // .iter() - // .filter_map(|(_, win)| win.wl_surface()?.client()) - // { - // data.state - // .client_compositor_state(&client) - // .blocker_cleared(&mut data.state, &data.display.handle()) - // } - // - // // schedule on all idle - // data.state.schedule( - // move |_dt| { - // // tracing::debug!("Waiting for all to be idle"); - // let all_idle = - // pending_wins - // .iter() - // .filter(|(_, win)| win.alive()) - // .all(|(_, win)| { - // win.with_state(|state| state.loc_request_state.is_idle()) - // }); - // - // all_idle - // }, - // move |dt| { - // for (loc, win) in non_pending_wins { - // dt.state.space.map_element(win, loc, false); - // } - // for win in windows_not_on_foc_tags { - // dt.state.space.unmap_elem(&win); - // } - // dt.state.pause_rendering = false; - // }, - // ); - // }, - // ); } } diff --git a/src/window/window_state.rs b/src/window/window_state.rs index 0b346fc..788be8d 100644 --- a/src/window/window_state.rs +++ b/src/window/window_state.rs @@ -122,14 +122,6 @@ impl LocationRequestState { pub fn is_idle(&self) -> bool { matches!(self, Self::Idle) } - - /// Returns `true` if the location request state is [`Acknowledged`]. - /// - /// [`Acknowledged`]: LocationRequestState::Acknowledged - #[must_use] - pub fn is_acknowledged(&self) -> bool { - matches!(self, Self::Acknowledged(..)) - } } impl WindowElement {