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 <jmcdonnell@blackberry.com>
This commit is contained in:
Tuomas Vaarala 2025-03-24 12:56:40 +02:00
parent 45f6785078
commit 1e10ede244

View File

@ -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]);