From edbefbd8fac20bc1f0a2550b48f86798006abd0c Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Sat, 3 Dec 2016 13:01:10 +0100 Subject: [PATCH] fix(controller): Check runstate when handling X event --- src/components/controller.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/controller.cpp b/src/components/controller.cpp index 58fee357..09a86968 100644 --- a/src/components/controller.cpp +++ b/src/components/controller.cpp @@ -281,7 +281,7 @@ void controller::wait_for_xevent() { if ((error = m_connection.connection_has_error()) != 0) { m_log.err("Error in X event loop, terminating... (%s)", m_connection.error_str(error)); kill(getpid(), SIGTERM); - } else if ((evt = m_connection.wait_for_event()) != nullptr) { + } else if ((evt = m_connection.wait_for_event()) != nullptr && m_running) { m_connection.dispatch_event(evt); } } catch (const exception& err) {