further fixes to monitor disabling on launch

This commit is contained in:
vaxerski
2022-08-10 13:44:04 +02:00
parent a564be73c5
commit 15fc0892c7
3 changed files with 19 additions and 7 deletions

View File

@@ -6,6 +6,8 @@ void CMonitor::onConnect(bool noRule) {
if (m_bEnabled)
return;
szName = output->name;
// get monitor rule that matches
SMonitorRule monitorRule = g_pConfigManager->getMonitorRuleFor(output->name);
@@ -37,9 +39,16 @@ void CMonitor::onConnect(bool noRule) {
if (PREFSTATE)
wlr_output_set_mode(output, PREFSTATE);
else
Debug::log(WARN, "No mode found for disabled output %s", output->name)
wlr_output_enable(output, 0);
wlr_output_commit(output);
if (!wlr_output_commit(output)) {
Debug::log(ERR, "Couldn't commit disabled state on output %s", output->name);
}
Events::listener_change(nullptr, nullptr);
m_bEnabled = false;
@@ -47,6 +56,11 @@ void CMonitor::onConnect(bool noRule) {
return;
}
if (!m_bRenderingInitPassed) {
wlr_output_init_render(output, g_pCompositor->m_sWLRAllocator, g_pCompositor->m_sWLRRenderer);
m_bRenderingInitPassed = true;
}
if (!m_pThisWrap) {
// find the wrap
@@ -64,8 +78,6 @@ void CMonitor::onConnect(bool noRule) {
m_bEnabled = true;
szName = output->name;
wlr_output_set_scale(output, monitorRule.scale);
wlr_xcursor_manager_load(g_pCompositor->m_sWLRXCursorMgr, monitorRule.scale);
wlr_output_set_transform(output, WL_OUTPUT_TRANSFORM_NORMAL); // TODO: support other transforms