diff options
author | vaxerski <[email protected]> | 2022-05-29 00:00:47 +0200 |
---|---|---|
committer | vaxerski <[email protected]> | 2022-05-29 00:00:47 +0200 |
commit | 3f8845a6a741a2a6532ef4b15d731b82224fb62c (patch) | |
tree | 25e3fa03bee2807f95cc2fb585019ad5fed50686 | |
parent | 894ae2d74217f4c37653022d855d00fd46c39457 (diff) | |
download | Hyprland-3f8845a6a741a2a6532ef4b15d731b82224fb62c.tar.gz Hyprland-3f8845a6a741a2a6532ef4b15d731b82224fb62c.zip |
Added an exit dispatcher and no more SIGSEGV on exit
-rw-r--r-- | src/Compositor.cpp | 3 | ||||
-rw-r--r-- | src/gmon.out | bin | 0 -> 604404 bytes | |||
-rw-r--r-- | src/managers/KeybindManager.cpp | 6 | ||||
-rw-r--r-- | src/managers/KeybindManager.hpp | 1 |
4 files changed, 10 insertions, 0 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp index b554f361..ed044fc8 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -144,6 +144,9 @@ void CCompositor::cleanupExit() { if (!m_sWLDisplay) return; + m_lWorkspaces.clear(); + m_lWindows.clear(); + if (g_pXWaylandManager->m_sWLRXWayland) { wlr_xwayland_destroy(g_pXWaylandManager->m_sWLRXWayland); g_pXWaylandManager->m_sWLRXWayland = nullptr; diff --git a/src/gmon.out b/src/gmon.out Binary files differnew file mode 100644 index 00000000..681e51e9 --- /dev/null +++ b/src/gmon.out diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index f37c853f..f2efb29b 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -20,6 +20,7 @@ CKeybindManager::CKeybindManager() { m_mDispatchers["focusmonitor"] = focusMonitor; m_mDispatchers["movecursortocorner"] = moveCursorToCorner; m_mDispatchers["workspaceopt"] = workspaceOpt; + m_mDispatchers["exit"] = exitHyprland; } void CKeybindManager::addKeybind(SKeybind kb) { @@ -674,4 +675,9 @@ void CKeybindManager::workspaceOpt(std::string args) { // recalc mon g_pLayoutManager->getCurrentLayout()->recalculateMonitor(g_pCompositor->m_pLastMonitor->ID); +} + +void CKeybindManager::exitHyprland(std::string argz) { + g_pCompositor->cleanupExit(); + exit(0); }
\ No newline at end of file diff --git a/src/managers/KeybindManager.hpp b/src/managers/KeybindManager.hpp index cf028111..cf9b36d2 100644 --- a/src/managers/KeybindManager.hpp +++ b/src/managers/KeybindManager.hpp @@ -50,6 +50,7 @@ private: static void toggleSplit(std::string); static void moveCursorToCorner(std::string); static void workspaceOpt(std::string); + static void exitHyprland(std::string); }; inline std::unique_ptr<CKeybindManager> g_pKeybindManager;
\ No newline at end of file |