mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-07 17:25:58 +01:00
monitors: guard output when read
This commit is contained in:
parent
d9d57ce39a
commit
5d44ea802a
3 changed files with 12 additions and 0 deletions
|
@ -1836,6 +1836,9 @@ CMonitor* CCompositor::getMonitorFromString(const std::string& name) {
|
||||||
const auto DESCRIPTION = name.substr(5);
|
const auto DESCRIPTION = name.substr(5);
|
||||||
|
|
||||||
for (auto& m : m_vMonitors) {
|
for (auto& m : m_vMonitors) {
|
||||||
|
if (!m->output)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (m->output->description && std::string(m->output->description).find(DESCRIPTION) == 0) {
|
if (m->output->description && std::string(m->output->description).find(DESCRIPTION) == 0) {
|
||||||
return m.get();
|
return m.get();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1761,6 +1761,9 @@ bool CConfigManager::shouldBlurLS(const std::string& ns) {
|
||||||
|
|
||||||
void CConfigManager::ensureDPMS() {
|
void CConfigManager::ensureDPMS() {
|
||||||
for (auto& rm : g_pCompositor->m_vRealMonitors) {
|
for (auto& rm : g_pCompositor->m_vRealMonitors) {
|
||||||
|
if (!rm->output)
|
||||||
|
continue;
|
||||||
|
|
||||||
auto rule = getMonitorRuleFor(rm->szName, rm->output->description ? rm->output->description : "");
|
auto rule = getMonitorRuleFor(rm->szName, rm->output->description ? rm->output->description : "");
|
||||||
|
|
||||||
if (rule.disabled == rm->m_bEnabled) {
|
if (rule.disabled == rm->m_bEnabled) {
|
||||||
|
@ -1774,6 +1777,9 @@ void CConfigManager::ensureVRR(CMonitor* pMonitor) {
|
||||||
static auto* const PVRR = &getConfigValuePtr("misc:vrr")->intValue;
|
static auto* const PVRR = &getConfigValuePtr("misc:vrr")->intValue;
|
||||||
|
|
||||||
static auto ensureVRRForDisplay = [&](CMonitor* m) -> void {
|
static auto ensureVRRForDisplay = [&](CMonitor* m) -> void {
|
||||||
|
if (!m->output)
|
||||||
|
return;
|
||||||
|
|
||||||
if (*PVRR == 0) {
|
if (*PVRR == 0) {
|
||||||
if (m->vrrActive) {
|
if (m->vrrActive) {
|
||||||
wlr_output_enable_adaptive_sync(m->output, 0);
|
wlr_output_enable_adaptive_sync(m->output, 0);
|
||||||
|
|
|
@ -1661,6 +1661,9 @@ void CKeybindManager::forceRendererReload(std::string args) {
|
||||||
bool overAgain = false;
|
bool overAgain = false;
|
||||||
|
|
||||||
for (auto& m : g_pCompositor->m_vMonitors) {
|
for (auto& m : g_pCompositor->m_vMonitors) {
|
||||||
|
if (!m->output)
|
||||||
|
continue;
|
||||||
|
|
||||||
auto rule = g_pConfigManager->getMonitorRuleFor(m->szName, m->output->description ? m->output->description : "");
|
auto rule = g_pConfigManager->getMonitorRuleFor(m->szName, m->output->description ? m->output->description : "");
|
||||||
if (!g_pHyprRenderer->applyMonitorRule(m.get(), &rule, true)) {
|
if (!g_pHyprRenderer->applyMonitorRule(m.get(), &rule, true)) {
|
||||||
overAgain = true;
|
overAgain = true;
|
||||||
|
|
Loading…
Reference in a new issue