Stop Xwayland server when X11 connection breaks

There is no point for processing X11 events if the connection has been
shut down due to a fatal error.
This commit is contained in:
Vlad Zahorodnii 2020-07-22 09:03:27 +03:00
parent 5aef9da884
commit 7ec93493c9

View file

@ -190,6 +190,13 @@ void Xwayland::dispatchEvents()
return;
}
const int connectionError = xcb_connection_has_error(connection);
if (connectionError) {
qCWarning(KWIN_XWL, "The X11 connection broke (error %d)", connectionError);
stop();
return;
}
while (xcb_generic_event_t *event = xcb_poll_for_event(connection)) {
if (m_dataBridge->filterEvent(event)) {
free(event);