mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-22 23:09:51 +01:00
monitors: fixes to unsafe mode
This commit is contained in:
parent
569ae86c90
commit
25d3d73dbf
2 changed files with 10 additions and 0 deletions
|
@ -1693,6 +1693,9 @@ void CConfigManager::performMonitorReload() {
|
|||
bool overAgain = false;
|
||||
|
||||
for (auto& m : g_pCompositor->m_vRealMonitors) {
|
||||
if (!m->output)
|
||||
continue;
|
||||
|
||||
auto rule = getMonitorRuleFor(m->szName, m->output->description ? m->output->description : "");
|
||||
|
||||
if (!g_pHyprRenderer->applyMonitorRule(m.get(), &rule)) {
|
||||
|
|
|
@ -106,6 +106,10 @@ void Events::listener_monitorFrame(void* owner, void* data) {
|
|||
|
||||
if ((g_pCompositor->m_sWLRSession && !g_pCompositor->m_sWLRSession->active) || !g_pCompositor->m_bSessionActive || g_pCompositor->m_bUnsafeState) {
|
||||
Debug::log(WARN, "Attempted to render frame on inactive session!");
|
||||
|
||||
if (g_pCompositor->m_bUnsafeState)
|
||||
g_pConfigManager->performMonitorReload();
|
||||
|
||||
return; // cannot draw on session inactive (different tty)
|
||||
}
|
||||
|
||||
|
@ -351,6 +355,9 @@ void Events::listener_monitorDestroy(void* owner, void* data) {
|
|||
|
||||
pMonitor->onDisconnect();
|
||||
|
||||
pMonitor->output = nullptr;
|
||||
pMonitor->m_bRenderingInitPassed = false;
|
||||
|
||||
// cleanup if not unsafe
|
||||
if (!g_pCompositor->m_bUnsafeState) {
|
||||
Debug::log(LOG, "Removing monitor %s from realMonitors", pMonitor->output->name);
|
||||
|
|
Loading…
Reference in a new issue