diff options
author | Kevin Ottens <kevin.ottens.qnx@kdab.com> | 2012-05-07 10:02:33 (GMT) |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-10 10:52:57 (GMT) |
commit | 0213f0faa694d81e3d5096856f3214fb5336304e (patch) | |
tree | 01d105de9df0be3868ab8df76fcb96fb729da5b6 /src | |
parent | aba489cb0ae7b17cbf995948647976ccca6c4e5d (diff) | |
download | Qt-0213f0faa694d81e3d5096856f3214fb5336304e.zip Qt-0213f0faa694d81e3d5096856f3214fb5336304e.tar.gz Qt-0213f0faa694d81e3d5096856f3214fb5336304e.tar.bz2 |
Emit signals to notify window (de)activation
The event notifier now deals also with the windowActive and
windowInactive PPS messages. The event handler simply emit the
corresponding signals.
(This is a backport from qtbase commit
f74e5a03598e102a1d81eb4fca58e41db713e5dc)
Change-Id: If9ae70d132e6a38a2dd728d8eba31dfd144e9978
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'src')
4 files changed, 46 insertions, 0 deletions
diff --git a/src/plugins/platforms/blackberry/qbbbpseventfilter.cpp b/src/plugins/platforms/blackberry/qbbbpseventfilter.cpp index 79a48f6..a9e8523 100644 --- a/src/plugins/platforms/blackberry/qbbbpseventfilter.cpp +++ b/src/plugins/platforms/blackberry/qbbbpseventfilter.cpp @@ -190,6 +190,26 @@ bool QBBBpsEventFilter::handleNavigatorEvent(bps_event_t *event) mNavigatorEventHandler->handleExit(); break; + case NAVIGATOR_WINDOW_ACTIVE: { + #if defined(QBBBPSEVENTFILTER_DEBUG) + qDebug() << "QBB: Navigator WINDOW ACTIVE event"; + #endif + + const QByteArray id(navigator_event_get_groupid(event)); + mNavigatorEventHandler->handleWindowGroupActivated(id); + break; + } + + case NAVIGATOR_WINDOW_INACTIVE: { + #if defined(QBBBPSEVENTFILTER_DEBUG) + qDebug() << "QBB: Navigator WINDOW INACTIVE event"; + #endif + + const QByteArray id(navigator_event_get_groupid(event)); + mNavigatorEventHandler->handleWindowGroupDeactivated(id); + break; + } + default: #if defined(QBBBPSEVENTFILTER_DEBUG) qDebug() << "QBB: Unhandled navigator event. code=" << bps_event_get_code(event); diff --git a/src/plugins/platforms/blackberry/qbbnavigatoreventhandler.cpp b/src/plugins/platforms/blackberry/qbbnavigatoreventhandler.cpp index 4f740b3..449bf84 100644 --- a/src/plugins/platforms/blackberry/qbbnavigatoreventhandler.cpp +++ b/src/plugins/platforms/blackberry/qbbnavigatoreventhandler.cpp @@ -98,4 +98,22 @@ void QBBNavigatorEventHandler::handleExit() QApplication::quit(); } +void QBBNavigatorEventHandler::handleWindowGroupActivated(const QByteArray &id) +{ +#if defined(QBBNAVIGATOREVENTHANDLER_DEBUG) + qDebug() << Q_FUNC_INFO << id; +#endif + + Q_EMIT windowGroupActivated(id); +} + +void QBBNavigatorEventHandler::handleWindowGroupDeactivated(const QByteArray &id) +{ +#if defined(QBBNAVIGATOREVENTHANDLER_DEBUG) + qDebug() << Q_FUNC_INFO << id; +#endif + + Q_EMIT windowGroupDeactivated(id); +} + QT_END_NAMESPACE diff --git a/src/plugins/platforms/blackberry/qbbnavigatoreventhandler.h b/src/plugins/platforms/blackberry/qbbnavigatoreventhandler.h index b2f6eda..a0b3622 100644 --- a/src/plugins/platforms/blackberry/qbbnavigatoreventhandler.h +++ b/src/plugins/platforms/blackberry/qbbnavigatoreventhandler.h @@ -54,9 +54,13 @@ public: void handleOrientationChange(int angle); void handleSwipeDown(); void handleExit(); + void handleWindowGroupActivated(const QByteArray &id); + void handleWindowGroupDeactivated(const QByteArray &id); Q_SIGNALS: void rotationChanged(int angle); + void windowGroupActivated(const QByteArray &id); + void windowGroupDeactivated(const QByteArray &id); }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/blackberry/qbbnavigatoreventnotifier.cpp b/src/plugins/platforms/blackberry/qbbnavigatoreventnotifier.cpp index 1516c5b..63ae8fb 100644 --- a/src/plugins/platforms/blackberry/qbbnavigatoreventnotifier.cpp +++ b/src/plugins/platforms/blackberry/qbbnavigatoreventnotifier.cpp @@ -192,6 +192,10 @@ void QBBNavigatorEventNotifier::handleMessage(const QByteArray &msg, const QByte mEventHandler->handleSwipeDown(); } else if (msg == "exit") { mEventHandler->handleExit(); + } else if (msg == "windowActive") { + mEventHandler->handleWindowGroupActivated(dat); + } else if (msg == "windowInactive") { + mEventHandler->handleWindowGroupDeactivated(dat); } } |