Commit 7ec93493 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

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.
parent 5aef9da8
...@@ -190,6 +190,13 @@ void Xwayland::dispatchEvents() ...@@ -190,6 +190,13 @@ void Xwayland::dispatchEvents()
return; 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)) { while (xcb_generic_event_t *event = xcb_poll_for_event(connection)) {
if (m_dataBridge->filterEvent(event)) { if (m_dataBridge->filterEvent(event)) {
free(event); free(event);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment