mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 19:05:59 +01:00
keybinds: Fix exit trigger by moving it to monitor.frame (#5240)
This commit is contained in:
parent
8001b96bb5
commit
6b28bf563e
5 changed files with 9 additions and 6 deletions
|
@ -118,6 +118,7 @@ class CCompositor {
|
|||
bool m_bUnsafeState = false; // unsafe state is when there is no monitors.
|
||||
bool m_bNextIsUnsafe = false; // because wlroots
|
||||
CMonitor* m_pUnsafeOutput = nullptr; // fallback output for the unsafe state
|
||||
bool m_bExitTriggered = false; // For exit dispatcher
|
||||
bool m_bIsShuttingDown = false;
|
||||
|
||||
// ------------------------------------------------- //
|
||||
|
|
|
@ -117,6 +117,13 @@ void Events::listener_newOutput(wl_listener* listener, void* data) {
|
|||
}
|
||||
|
||||
void Events::listener_monitorFrame(void* owner, void* data) {
|
||||
if (g_pCompositor->m_bExitTriggered) {
|
||||
// Only signal cleanup once
|
||||
g_pCompositor->m_bExitTriggered = false;
|
||||
g_pCompositor->cleanup();
|
||||
return;
|
||||
}
|
||||
|
||||
CMonitor* const PMONITOR = (CMonitor*)owner;
|
||||
|
||||
if ((g_pCompositor->m_sWLRSession && !g_pCompositor->m_sWLRSession->active) || !g_pCompositor->m_bSessionActive || g_pCompositor->m_bUnsafeState) {
|
||||
|
|
|
@ -1512,7 +1512,7 @@ void CKeybindManager::renameWorkspace(std::string args) {
|
|||
}
|
||||
|
||||
void CKeybindManager::exitHyprland(std::string argz) {
|
||||
g_pInputManager->m_bExitTriggered = true;
|
||||
g_pCompositor->m_bExitTriggered = true;
|
||||
}
|
||||
|
||||
void CKeybindManager::moveCurrentWorkspaceToMonitor(std::string args) {
|
||||
|
|
|
@ -1189,9 +1189,6 @@ void CInputManager::onKeyboardKey(wlr_keyboard_key_event* e, SKeyboard* pKeyboar
|
|||
|
||||
updateKeyboardsLeds(pKeyboard->keyboard);
|
||||
}
|
||||
|
||||
if (m_bExitTriggered)
|
||||
g_pCompositor->cleanup();
|
||||
}
|
||||
|
||||
void CInputManager::onKeyboardMod(void* data, SKeyboard* pKeyboard) {
|
||||
|
|
|
@ -251,8 +251,6 @@ class CInputManager {
|
|||
|
||||
void restoreCursorIconToApp(); // no-op if restored
|
||||
|
||||
bool m_bExitTriggered = false; // for exit dispatcher
|
||||
|
||||
friend class CKeybindManager;
|
||||
friend class CWLSurface;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue