From 1e10ede244b70455201df1c459b9586f3c015552 Mon Sep 17 00:00:00 2001 From: Tuomas Vaarala Date: Mon, 24 Mar 2025 12:56:40 +0200 Subject: [PATCH] Replace qFatal() statements with qWarning() in case of failed queries In some cases the QNX events can be stale ie. referring to a window object that is already destroyed. This is not necessarily a fatal condition, but there are some qFatal() statements in this case which could be removed. Fixes: QTBUG-135076 Pick-to: 5.15 6.5 6.8 6.9 Change-Id: I885fa95c323590a814176b8a70ef5b7ee332012c Reviewed-by: James McDonnell --- src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp b/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp index b451360c955..98ad02ca9bd 100644 --- a/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp +++ b/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp @@ -710,7 +710,7 @@ void QQnxScreenEventHandler::handlePropertyEvent(screen_event_t event) errno = 0; int property; if (Q_UNLIKELY(screen_get_event_property_iv(event, SCREEN_PROPERTY_NAME, &property) != 0)) - qFatal("QQnx: failed to query window property, errno=%d", errno); + qWarning("QQnx: failed to query window property, errno=%d", errno); switch (property) { case SCREEN_PROPERTY_FOCUS: @@ -731,7 +731,7 @@ void QQnxScreenEventHandler::handleKeyboardFocusPropertyEvent(screen_window_t wi errno = 0; int focus = 0; if (Q_UNLIKELY(window && screen_get_window_property_iv(window, SCREEN_PROPERTY_FOCUS, &focus) != 0)) - qFatal("QQnx: failed to query keyboard focus property, errno=%d", errno); + qWarning("QQnx: failed to query keyboard focus property, errno=%d", errno); QWindow *focusWindow = QQnxIntegration::instance()->window(window); @@ -747,12 +747,14 @@ void QQnxScreenEventHandler::handleGeometryPropertyEvent(screen_window_t window) { int pos[2]; if (screen_get_window_property_iv(window, SCREEN_PROPERTY_POSITION, pos) != 0) { - qFatal("QQnx: failed to query window property, errno=%d", errno); + qWarning("QQnx: failed to query window property, errno=%d", errno); + return; } int size[2]; if (screen_get_window_property_iv(window, SCREEN_PROPERTY_SIZE, size) != 0) { - qFatal("QQnx: failed to query window property, errno=%d", errno); + qWarning("QQnx: failed to query window property, errno=%d", errno); + return; } QRect rect(pos[0], pos[1], size[0], size[1]);