aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Compositor.cpp
diff options
context:
space:
mode:
authorvaxerski <[email protected]>2023-02-19 13:45:56 +0000
committervaxerski <[email protected]>2023-02-19 13:45:56 +0000
commit38c25bb50d76409193db2438db60369f3868edf9 (patch)
tree6450e68c394691c222209addb76d9940998a5c95 /src/Compositor.cpp
parent6548439f6ce205795bfe55fc22d30830c725e0d2 (diff)
downloadHyprland-38c25bb50d76409193db2438db60369f3868edf9.tar.gz
Hyprland-38c25bb50d76409193db2438db60369f3868edf9.zip
Added a crash reporter
Diffstat (limited to 'src/Compositor.cpp')
-rw-r--r--src/Compositor.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp
index 365a2c12..0b4970c2 100644
--- a/src/Compositor.cpp
+++ b/src/Compositor.cpp
@@ -2,6 +2,7 @@
#include "helpers/Splashes.hpp"
#include <random>
#include "debug/HyprCtl.hpp"
+#include "debug/CrashReporter.hpp"
#ifdef USES_SYSTEMD
#include <systemd/sd-daemon.h> // for sd_notify
#endif
@@ -16,6 +17,11 @@ int handleCritSignal(int signo, void* data) {
return 0; // everything went fine
}
+void handleSegv(int sig) {
+ CrashReporter::createAndSaveCrash();
+ exit(SIGSEGV);
+}
+
CCompositor::CCompositor() {
wlr_log_init(WLR_INFO, NULL);
@@ -61,6 +67,7 @@ CCompositor::CCompositor() {
// register crit signal handler
wl_event_loop_add_signal(m_sWLEventLoop, SIGTERM, handleCritSignal, nullptr);
+ signal(SIGSEGV, handleSegv);
//wl_event_loop_add_signal(m_sWLEventLoop, SIGINT, handleCritSignal, nullptr);
m_sWLRBackend = wlr_backend_autocreate(m_sWLDisplay, &m_sWLRSession);