Debug: send initial configure in new_toplevel, add window state logging

- Send xdg_toplevel configure before mapping window (foot needs this)
- Add window bbox and configure state debug logging
- Still investigating: foot connects but bbox stays 0x0 (no buffer committed)
This commit is contained in:
Till Wegmueller 2026-04-07 18:59:17 +02:00
parent 9fc27d3b56
commit 8d248a8f52
2 changed files with 21 additions and 0 deletions

View file

@ -235,6 +235,17 @@ fn render_headless_frame(data: &mut CalloopData) {
let element_count = data.state.space.elements().count(); let element_count = data.state.space.elements().count();
tracing::debug!(element_count, "render tick"); tracing::debug!(element_count, "render tick");
// Check if window toplevel has been configured.
if element_count > 0 {
for window in data.state.space.elements() {
if let Some(toplevel) = window.toplevel() {
let configured = toplevel.is_initial_configure_sent();
let bbox = window.bbox();
tracing::info!(configured, ?bbox, "window state");
}
}
}
let custom_elements: &[TextureRenderElement<PixmanTexture>] = &[]; let custom_elements: &[TextureRenderElement<PixmanTexture>] = &[];
let render_result = render_output::<_, _, Window, _>( let render_result = render_output::<_, _, Window, _>(
@ -268,6 +279,14 @@ fn render_headless_frame(data: &mut CalloopData) {
std::slice::from_raw_parts(ptr, frame_bytes) std::slice::from_raw_parts(ptr, frame_bytes)
}; };
// One-shot content check for debugging.
if element_count > 0 {
let non_bg = pixels.chunks_exact(4).any(|p| p != [25, 25, 25, 255]);
if non_bg {
tracing::info!("client surface rendered successfully");
}
}
// Send frame over network if a client is connected. // Send frame over network if a client is connected.
if data.client_connected { if data.client_connected {
send_frame_to_network(data, pixels, &damage, output_size.w, output_size.h, stride); send_frame_to_network(data, pixels, &damage, output_size.w, output_size.h, stride);

View file

@ -21,6 +21,8 @@ impl XdgShellHandler for WayRay {
} }
fn new_toplevel(&mut self, surface: ToplevelSurface) { fn new_toplevel(&mut self, surface: ToplevelSurface) {
// Send the initial configure so the client can start drawing.
surface.send_configure();
let window = Window::new_wayland_window(surface); let window = Window::new_wayland_window(surface);
self.space.map_element(window, (0, 0), false); self.space.map_element(window, (0, 0), false);
info!("new toplevel mapped"); info!("new toplevel mapped");