diff --git a/src/window/wayland.cpp b/src/window/wayland.cpp index e2e03c8..bfe057c 100644 --- a/src/window/wayland.cpp +++ b/src/window/wayland.cpp @@ -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);