internal: Move CMonitor to SP (#8178)

* move monitors to sp

* XD
This commit is contained in:
Vaxry
2024-10-19 23:03:29 +01:00
committed by GitHub
parent ce3ba798df
commit f044e4c951
66 changed files with 424 additions and 446 deletions

View File

@@ -943,9 +943,9 @@ void CConfigManager::postConfigReload(const Hyprlang::CParseResult& result) {
for (auto const& m : g_pCompositor->m_vMonitors) {
// mark blur dirty
g_pHyprOpenGL->markBlurDirtyForMonitor(m.get());
g_pHyprOpenGL->markBlurDirtyForMonitor(m);
g_pCompositor->scheduleFrameForMonitor(m.get());
g_pCompositor->scheduleFrameForMonitor(m);
// Force the compositor to fully re-render all monitors
m->forceFullFrames = 2;
@@ -1506,7 +1506,7 @@ void CConfigManager::performMonitorReload() {
auto rule = getMonitorRuleFor(m);
if (!g_pHyprRenderer->applyMonitorRule(m.get(), &rule)) {
if (!g_pHyprRenderer->applyMonitorRule(m, &rule)) {
overAgain = true;
break;
}
@@ -1564,14 +1564,14 @@ void CConfigManager::ensureMonitorStatus() {
auto rule = getMonitorRuleFor(rm);
if (rule.disabled == rm->m_bEnabled)
g_pHyprRenderer->applyMonitorRule(rm.get(), &rule);
g_pHyprRenderer->applyMonitorRule(rm, &rule);
}
}
void CConfigManager::ensureVRR(CMonitor* pMonitor) {
void CConfigManager::ensureVRR(PHLMONITOR pMonitor) {
static auto PVRR = reinterpret_cast<Hyprlang::INT* const*>(getConfigValuePtr("misc:vrr"));
static auto ensureVRRForDisplay = [&](CMonitor* m) -> void {
static auto ensureVRRForDisplay = [&](PHLMONITOR m) -> void {
if (!m->output || m->createdByUser)
return;
@@ -1641,7 +1641,7 @@ void CConfigManager::ensureVRR(CMonitor* pMonitor) {
}
for (auto const& m : g_pCompositor->m_vMonitors) {
ensureVRRForDisplay(m.get());
ensureVRRForDisplay(m);
}
}
@@ -1653,7 +1653,7 @@ void CConfigManager::addParseError(const std::string& err) {
g_pHyprError->queueCreate(err + "\nHyprland may not work correctly.", CColor(1.0, 50.0 / 255.0, 50.0 / 255.0, 1.0));
}
CMonitor* CConfigManager::getBoundMonitorForWS(const std::string& wsname) {
PHLMONITOR CConfigManager::getBoundMonitorForWS(const std::string& wsname) {
auto monitor = getBoundMonitorStringForWS(wsname);
if (monitor.substr(0, 5) == "desc:")
return g_pCompositor->getMonitorFromDesc(monitor.substr(5));