Fix window render order

This commit is contained in:
Ottatop 2023-09-09 04:34:17 -05:00
parent 9c3df5ce88
commit 866f9eec5d
4 changed files with 29 additions and 4 deletions

View file

@ -72,7 +72,7 @@ use smithay::{
backend::GlobalId, protocol::wl_surface::WlSurface, Display, DisplayHandle,
},
},
utils::{Clock, DeviceFd, Logical, Monotonic, Physical, Point, Rectangle, Transform},
utils::{Clock, DeviceFd, IsAlive, Logical, Monotonic, Physical, Point, Rectangle, Transform},
wayland::{
dmabuf::{DmabufFeedback, DmabufFeedbackBuilder, DmabufGlobal, DmabufState},
input_method::{InputMethodHandle, InputMethodSeat},
@ -1332,10 +1332,18 @@ impl State {
return;
};
let windows = self
.focus_state
.focus_stack
.iter()
.filter(|win| win.alive())
.cloned()
.collect::<Vec<_>>();
let result = render_surface(
&mut self.cursor_status,
&self.space,
&self.windows,
&windows,
self.dnd_icon.as_ref(),
&self.focus_state.focus_stack,
surface,

View file

@ -248,9 +248,17 @@ pub fn run_winit() -> anyhow::Result<()> {
state.focus_state.fix_up_focus(&mut state.space);
let windows = state
.focus_state
.focus_stack
.iter()
.filter(|win| win.alive())
.cloned()
.collect::<Vec<_>>();
let output_render_elements = crate::render::generate_render_elements(
&state.space,
&state.windows,
&windows,
state.pointer_location,
&mut state.cursor_status,
state.dnd_icon.as_ref(),

View file

@ -20,6 +20,7 @@ use smithay::{
input::{
keyboard::{keysyms, FilterResult},
pointer::{AxisFrame, ButtonEvent, MotionEvent},
SeatHandler,
},
reexports::wayland_protocols::xdg::shell::server::xdg_toplevel::ResizeEdge,
utils::{Logical, Point, SERIAL_COUNTER},

View file

@ -166,12 +166,20 @@ impl State {
// schedule on all idle
self.schedule(
move |_dt| {
// tracing::debug!("Waiting for all to be idle");
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()));
let num_not_idle = pending_wins
.iter()
.filter(|(_, win)| win.alive())
.filter(|(_, win)| !win.with_state(|state| state.loc_request_state.is_idle()))
.count();
tracing::debug!("{num_not_idle} not idle");
all_idle
},
move |dt| {