From 9597e0d2a23c4673aea7a74598a6a634527c443c Mon Sep 17 00:00:00 2001 From: James Turner Date: Thu, 30 Aug 2012 11:02:25 +0100 Subject: [PATCH] Avoid a warning from the QNX QPA plugin. The HDMI display on the Playbook is listed, but (normally) unattached, and hence generates an error if we attempt to register for events. This patch avoids the warning; a future change will actually watch for screens being attached / detached and update the QPlatformScreens and event registration correctly. Change-Id: I5a9cc773648d50f657fe1b3611fd42495ca7e836 Reviewed-by: Sean Harmer Reviewed-by: Thomas McGuire --- src/plugins/platforms/qnx/qqnxbpseventfilter.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/plugins/platforms/qnx/qqnxbpseventfilter.cpp b/src/plugins/platforms/qnx/qqnxbpseventfilter.cpp index 4ce38b9fdcf..2e4583119f3 100644 --- a/src/plugins/platforms/qnx/qqnxbpseventfilter.cpp +++ b/src/plugins/platforms/qnx/qqnxbpseventfilter.cpp @@ -100,6 +100,17 @@ void QQnxBpsEventFilter::registerForScreenEvents(QQnxScreen *screen) return; } + int attached; + if (screen_get_display_property_iv(screen->nativeDisplay(), SCREEN_PROPERTY_ATTACHED, &attached) != BPS_SUCCESS) { + qWarning() << "QQNX: unable to query display attachment"; + return; + } + + if (!attached) { + qBpsEventFilterDebug() << "skipping event registration for non-attached screen"; + return; + } + if (screen_request_events(screen->nativeContext()) != BPS_SUCCESS) qWarning("QQNX: failed to register for screen events on screen %p", screen->nativeContext()); }