Add more logging

This commit is contained in:
Ottatop 2023-09-12 09:29:21 -05:00
parent c0909e570a
commit 7bf411a426
2 changed files with 13 additions and 16 deletions

View file

@ -1452,15 +1452,20 @@ fn render_surface<'a>(
pointer_location: Point<f64, Logical>,
clock: &Clock<Monotonic>,
) -> Result<bool, SwapBuffersError> {
let pending_win_count = windows
let pending_wins = windows
.iter()
.filter(|win| win.alive())
.filter(|win| win.with_state(|state| !state.loc_request_state.is_idle()))
.count() as u32;
.map(|win| {
(
win.class().unwrap_or("None".to_string()),
win.title().unwrap_or("None".to_string()),
)
})
.collect::<Vec<_>>();
tracing::debug!("pending_win_count is {pending_win_count}");
if pending_win_count > 0 {
if !pending_wins.is_empty() {
tracing::debug!("Skipping frame, waiting on {pending_wins:?}");
for win in windows.iter() {
win.send_frame(output, clock.now(), Some(Duration::ZERO), |_, _| {
Some(output.clone())

View file

@ -128,11 +128,12 @@ impl State {
// (like tiled states) but not commit, so we check for just the size
// here
if !is_pending {
tracing::debug!("No pending changes");
tracing::debug!("No pending changes, mapping window");
// TODO: map win here, not down there
state.loc_request_state = LocationRequestState::Idle;
non_pending_wins.push((loc, window.clone()));
} else {
tracing::debug!("Pending changes");
tracing::debug!("Pending changes, requesting commit");
let serial = win.toplevel().send_configure();
state.loc_request_state =
LocationRequestState::Requested(serial, loc);
@ -154,14 +155,6 @@ impl State {
});
}
// 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.
//
// This *will* cause everything to freeze for a few frames, but it shouldn't impact
// anything meaningfully.
// self.pause_rendering = true;
// schedule on all idle
self.schedule(
move |_dt| {
@ -176,7 +169,6 @@ impl State {
for (loc, win) in non_pending_wins {
dt.state.space.map_element(win, loc, false);
}
// dt.state.pause_rendering = false;
},
);
}