From 49dbb586e341b5aeb451897ddfe7b46dd538b8c9 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Wed, 13 Jul 2022 18:31:09 +0200 Subject: [PATCH] fixed session-less envs --- src/Compositor.cpp | 5 +++-- src/events/Monitors.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Compositor.cpp b/src/Compositor.cpp index b0949d89..20ce779b 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -190,7 +190,8 @@ void CCompositor::initAllSignals() { addWLSignal(&m_sWLRVirtPtrMgr->events.new_virtual_pointer, &Events::listen_newVirtPtr, m_sWLRVirtPtrMgr, "VirtPtrMgr"); addWLSignal(&m_sWLRRenderer->events.destroy, &Events::listen_RendererDestroy, m_sWLRRenderer, "WLRRenderer"); addWLSignal(&m_sWLRIdleInhibitMgr->events.new_inhibitor, &Events::listen_newIdleInhibitor, m_sWLRIdleInhibitMgr, "WLRIdleInhibitMgr"); - addWLSignal(&m_sWLRSession->events.active, &Events::listen_sessionActive, m_sWLRSession, "Session"); + if (m_sWLRSession) + addWLSignal(&m_sWLRSession->events.active, &Events::listen_sessionActive, m_sWLRSession, "Session"); } void CCompositor::cleanup() { @@ -1346,7 +1347,7 @@ void CCompositor::updateWorkspaceWindowDecos(const int& id) { } void CCompositor::scheduleFrameForMonitor(SMonitor* pMonitor) { - if (!m_sWLRSession->active || !m_bSessionActive) + if ((m_sWLRSession && !m_sWLRSession->active) || !m_bSessionActive) return; wlr_output_schedule_frame(pMonitor->output); diff --git a/src/events/Monitors.cpp b/src/events/Monitors.cpp index 949d4585..24a8faa7 100644 --- a/src/events/Monitors.cpp +++ b/src/events/Monitors.cpp @@ -166,7 +166,7 @@ void Events::listener_newOutput(wl_listener* listener, void* data) { void Events::listener_monitorFrame(void* owner, void* data) { SMonitor* const PMONITOR = (SMonitor*)owner; - if (!g_pCompositor->m_sWLRSession->active || !g_pCompositor->m_bSessionActive) { + if ((g_pCompositor->m_sWLRSession && !g_pCompositor->m_sWLRSession->active) || !g_pCompositor->m_bSessionActive) { Debug::log(WARN, "Attempted to render frame on inactive session!"); return; // cannot draw on session inactive (different tty) }