From 0213f0faa694d81e3d5096856f3214fb5336304e Mon Sep 17 00:00:00 2001 From: Kevin Ottens Date: Mon, 7 May 2012 12:02:33 +0200 Subject: 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 Reviewed-by: Giuseppe D'Angelo --- .../platforms/blackberry/qbbbpseventfilter.cpp | 20 ++++++++++++++++++++ .../blackberry/qbbnavigatoreventhandler.cpp | 18 ++++++++++++++++++ .../platforms/blackberry/qbbnavigatoreventhandler.h | 4 ++++ .../blackberry/qbbnavigatoreventnotifier.cpp | 4 ++++ 4 files changed, 46 insertions(+) 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); } } -- cgit v0.12