feat: m_running = true at the better place

This commit is contained in:
2026-02-13 18:38:53 +01:00
parent 00f6036041
commit 88442608e3

View File

@@ -92,6 +92,7 @@ WaylandWindowImpl::WaylandWindowImpl(size_t width, size_t height)
m_toplevel_listener.wm_capabilities = xtoplevel_handle_wm_capabilities;
xdg_toplevel_add_listener(m_toplevel, &m_toplevel_listener, this);
m_running = true;
wl_surface_commit(m_wsurface);
}
@@ -100,6 +101,8 @@ WaylandWindowImpl::~WaylandWindowImpl() { m_running = false; }
void WaylandWindowImpl::OnFrame(IFrameListener fn) { m_on_frame = fn; }
bool WaylandWindowImpl::Dispatch() {
if (!m_running) return false;
auto display = WaylandState::GetInstance()->m_display;
printf("[DEBUG-WAYLAND]: checking if redraw needed, cb_pending = %d, "
@@ -165,7 +168,6 @@ void WaylandWindowImpl::xsurface_handle_configure(void *data,
xdg_surface_ack_configure(surface, serial);
window->m_running = true;
window->m_redraw_requested = true;
wl_surface_commit(window->m_wsurface);