monitors: fix outputmgr nullptr crash (#4738)

This commit is contained in:
Alessio Molinari 2024-02-18 03:24:01 +01:00 committed by GitHub
parent 683a4b07c5
commit 7e8bcd675d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 13 additions and 2 deletions

View file

@ -1340,8 +1340,6 @@ void CHyprRenderer::outputMgrApplyTest(wlr_output_configuration_v1* config, bool
std::string commandForCfg = "";
const auto OUTPUT = head->state.output;
const auto PMONITOR = g_pCompositor->getMonitorFromOutput(OUTPUT);
RASSERT(PMONITOR, "nullptr monitor in outputMgrApplyTest");
commandForCfg += std::string(OUTPUT->name) + ",";
@ -1352,6 +1350,8 @@ void CHyprRenderer::outputMgrApplyTest(wlr_output_configuration_v1* config, bool
continue;
}
const auto PMONITOR = g_pCompositor->getRealMonitorFromOutput(OUTPUT);
RASSERT(PMONITOR, "nullptr monitor in outputMgrApplyTest");
wlr_output_state_set_enabled(PMONITOR->state.wlr(), head->state.enabled);
if (head->state.mode)