fixed session-less envs

This commit is contained in:
vaxerski 2022-07-13 18:31:09 +02:00
parent 6708f3b133
commit 49dbb586e3
2 changed files with 4 additions and 3 deletions

View file

@ -190,6 +190,7 @@ void CCompositor::initAllSignals() {
addWLSignal(&m_sWLRVirtPtrMgr->events.new_virtual_pointer, &Events::listen_newVirtPtr, m_sWLRVirtPtrMgr, "VirtPtrMgr"); 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_sWLRRenderer->events.destroy, &Events::listen_RendererDestroy, m_sWLRRenderer, "WLRRenderer");
addWLSignal(&m_sWLRIdleInhibitMgr->events.new_inhibitor, &Events::listen_newIdleInhibitor, m_sWLRIdleInhibitMgr, "WLRIdleInhibitMgr"); addWLSignal(&m_sWLRIdleInhibitMgr->events.new_inhibitor, &Events::listen_newIdleInhibitor, m_sWLRIdleInhibitMgr, "WLRIdleInhibitMgr");
if (m_sWLRSession)
addWLSignal(&m_sWLRSession->events.active, &Events::listen_sessionActive, m_sWLRSession, "Session"); addWLSignal(&m_sWLRSession->events.active, &Events::listen_sessionActive, m_sWLRSession, "Session");
} }
@ -1346,7 +1347,7 @@ void CCompositor::updateWorkspaceWindowDecos(const int& id) {
} }
void CCompositor::scheduleFrameForMonitor(SMonitor* pMonitor) { void CCompositor::scheduleFrameForMonitor(SMonitor* pMonitor) {
if (!m_sWLRSession->active || !m_bSessionActive) if ((m_sWLRSession && !m_sWLRSession->active) || !m_bSessionActive)
return; return;
wlr_output_schedule_frame(pMonitor->output); wlr_output_schedule_frame(pMonitor->output);

View file

@ -166,7 +166,7 @@ void Events::listener_newOutput(wl_listener* listener, void* data) {
void Events::listener_monitorFrame(void* owner, void* data) { void Events::listener_monitorFrame(void* owner, void* data) {
SMonitor* const PMONITOR = (SMonitor*)owner; 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!"); Debug::log(WARN, "Attempted to render frame on inactive session!");
return; // cannot draw on session inactive (different tty) return; // cannot draw on session inactive (different tty)
} }