diff options
author | はれなよ <[email protected]> | 2024-06-30 03:04:48 +0900 |
---|---|---|
committer | GitHub <[email protected]> | 2024-06-29 20:04:48 +0200 |
commit | 1f43a5c859bfdf3dc6e880610e21cd9434a4e47b (patch) | |
tree | 1f5eeaa6c4c12396e41bd083dae107bbc1685678 /src/events | |
parent | 9c5dd59d4b1927b7d88e8e3c2e260eb01d95794b (diff) | |
download | Hyprland-1f43a5c859bfdf3dc6e880610e21cd9434a4e47b.tar.gz Hyprland-1f43a5c859bfdf3dc6e880610e21cd9434a4e47b.zip |
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
Diffstat (limited to 'src/events')
-rw-r--r-- | src/events/Misc.cpp | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/events/Misc.cpp b/src/events/Misc.cpp index 6580d93e..32f894ec 100644 --- a/src/events/Misc.cpp +++ b/src/events/Misc.cpp @@ -30,14 +30,25 @@ void Events::listener_RendererDestroy(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) { - g_pCompositor->scheduleFrameForMonitor(m.get()); - g_pHyprRenderer->applyMonitorRule(m.get(), &m->activeMonitorRule, true); - } + for (auto& m : g_pCompositor->m_vMonitors) { + g_pCompositor->scheduleFrameForMonitor(m.get()); + g_pHyprRenderer->applyMonitorRule(m.get(), &m->activeMonitorRule, true); + } + + g_pConfigManager->m_bWantsMonitorReload = true; + } else { + Debug::log(LOG, "Session got inactivated!"); - g_pConfigManager->m_bWantsMonitorReload = true; + g_pCompositor->m_bSessionActive = false; + + for (auto& m : g_pCompositor->m_vMonitors) { + m->noFrameSchedule = true; + m->framesToSkip = 1; + } + } } |