mirror of
https://github.com/hyprwm/Hyprland
synced 2025-02-17 00:42:11 +01:00
session: fix activate events being always treated as on (#6696)
* Fix listener_sessionActive to handle an event correctly when the session get inactivated * Remove log
This commit is contained in:
parent
9c5dd59d4b
commit
1f43a5c859
2 changed files with 19 additions and 19 deletions
|
@ -30,14 +30,25 @@ void Events::listener_RendererDestroy(wl_listener* listener, void* data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Events::listener_sessionActive(wl_listener* listener, void* data) {
|
void Events::listener_sessionActive(wl_listener* listener, void* data) {
|
||||||
Debug::log(LOG, "Session got activated!");
|
if (g_pCompositor->m_sWLRSession->active) {
|
||||||
|
Debug::log(LOG, "Session got activated!");
|
||||||
|
|
||||||
g_pCompositor->m_bSessionActive = true;
|
g_pCompositor->m_bSessionActive = true;
|
||||||
|
|
||||||
for (auto& m : g_pCompositor->m_vMonitors) {
|
for (auto& m : g_pCompositor->m_vMonitors) {
|
||||||
g_pCompositor->scheduleFrameForMonitor(m.get());
|
g_pCompositor->scheduleFrameForMonitor(m.get());
|
||||||
g_pHyprRenderer->applyMonitorRule(m.get(), &m->activeMonitorRule, true);
|
g_pHyprRenderer->applyMonitorRule(m.get(), &m->activeMonitorRule, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
g_pConfigManager->m_bWantsMonitorReload = true;
|
||||||
|
} else {
|
||||||
|
Debug::log(LOG, "Session got inactivated!");
|
||||||
|
|
||||||
|
g_pCompositor->m_bSessionActive = false;
|
||||||
|
|
||||||
|
for (auto& m : g_pCompositor->m_vMonitors) {
|
||||||
|
m->noFrameSchedule = true;
|
||||||
|
m->framesToSkip = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g_pConfigManager->m_bWantsMonitorReload = true;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -810,18 +810,7 @@ bool CKeybindManager::handleVT(xkb_keysym_t keysym) {
|
||||||
|
|
||||||
Debug::log(LOG, "Switching from VT {} to VT {}", ttynum, TTY);
|
Debug::log(LOG, "Switching from VT {} to VT {}", ttynum, TTY);
|
||||||
|
|
||||||
if (!wlr_session_change_vt(g_pCompositor->m_sWLRSession, TTY))
|
wlr_session_change_vt(g_pCompositor->m_sWLRSession, TTY);
|
||||||
return true; // probably same session
|
|
||||||
|
|
||||||
g_pCompositor->m_bSessionActive = false;
|
|
||||||
|
|
||||||
for (auto& m : g_pCompositor->m_vMonitors) {
|
|
||||||
m->noFrameSchedule = true;
|
|
||||||
m->framesToSkip = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
Debug::log(LOG, "Switched to VT {}, destroyed all render data, frames to skip for each: 2", TTY);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue