From b33813534e48e488e53eef73ab84dae7af0f76f5 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Mon, 3 Feb 2025 14:46:20 +0100 Subject: [PATCH] xcb: call qGuiApp->exit() on xcb connection error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: QTBUG-130741 Pick-to: 6.8 6.5 Change-Id: I67eff8e58d4a4a8d18fb49699111f72ed9100480 Reviewed-by: Tor Arne Vestbø (cherry picked from commit facf2c17707ac4827e624fb6e9546278aef0c38d) Reviewed-by: Qt Cherry-pick Bot --- src/plugins/platforms/xcb/qxcbconnection.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index 6de874e0383..e6d232d0ef9 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -1067,7 +1067,8 @@ void QXcbConnection::processXcbEvents(QEventLoop::ProcessEventsFlags flags) int connection_error = xcb_connection_has_error(xcb_connection()); if (connection_error) { qWarning("The X11 connection broke (error %d). Did the X11 server die?", connection_error); - exit(1); + qGuiApp->exit(connection_error); + return; } m_eventQueue->flushBufferedEvents();