fix(controller): Check for connection error in eventloop

This commit is contained in:
Michael Carlberg 2016-10-31 01:25:45 +01:00
parent 26c308cc19
commit dd7967dede

View file

@ -335,14 +335,16 @@ class controller {
m_connection.flush();
while (true) {
while (m_running) {
shared_ptr<xcb_generic_event_t> evt;
if ((evt = m_connection.wait_for_event()))
m_connection.dispatch_event(evt);
if (!m_running)
if (m_connection.connection_has_error()) {
break;
}
if ((evt = m_connection.wait_for_event())) {
m_connection.dispatch_event(evt);
}
}
}