diff options
author | Kevin Ottens <kevin.ottens.qnx@kdab.com> | 2012-05-07 10:10:04 (GMT) |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-10 10:52:59 (GMT) |
commit | 21d91ec14eea21f07bc58c171df000f87caf6c3d (patch) | |
tree | f7022f5e5416d12a035f32dfd0497d33d1ac35a0 | |
parent | 0213f0faa694d81e3d5096856f3214fb5336304e (diff) | |
download | Qt-21d91ec14eea21f07bc58c171df000f87caf6c3d.zip Qt-21d91ec14eea21f07bc58c171df000f87caf6c3d.tar.gz Qt-21d91ec14eea21f07bc58c171df000f87caf6c3d.tar.bz2 |
Advertise window (de)activation to Qt event system
The integration plugin now connects screens to the newly introduced
signals of the navigator event handler. The relevant screen then push a
corresponding event to the Qt event loop.
(This is a backport from qtbase commit
b6a4d69830c0d188b4f6c424808390dd8e3a90bc)
Change-Id: I28c8843f2aea75bc685dcfd6e005bc628bc69202
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
-rw-r--r-- | src/plugins/platforms/blackberry/qbbintegration.cpp | 2 | ||||
-rw-r--r-- | src/plugins/platforms/blackberry/qbbscreen.cpp | 30 | ||||
-rw-r--r-- | src/plugins/platforms/blackberry/qbbscreen.h | 2 |
3 files changed, 34 insertions, 0 deletions
diff --git a/src/plugins/platforms/blackberry/qbbintegration.cpp b/src/plugins/platforms/blackberry/qbbintegration.cpp index 28484ba..6283bb1 100644 --- a/src/plugins/platforms/blackberry/qbbintegration.cpp +++ b/src/plugins/platforms/blackberry/qbbintegration.cpp @@ -349,6 +349,8 @@ void QBBIntegration::createDisplays() screen, SLOT(windowClosed(screen_window_t))); QObject::connect(mNavigatorEventHandler, SIGNAL(rotationChanged(int)), screen, SLOT(setRotation(int))); + QObject::connect(mNavigatorEventHandler, SIGNAL(windowGroupActivated(QByteArray)), screen, SLOT(activateWindowGroup(QByteArray))); + QObject::connect(mNavigatorEventHandler, SIGNAL(windowGroupDeactivated(QByteArray)), screen, SLOT(deactivateWindowGroup(QByteArray))); } } diff --git a/src/plugins/platforms/blackberry/qbbscreen.cpp b/src/plugins/platforms/blackberry/qbbscreen.cpp index 30630f1..206e307 100644 --- a/src/plugins/platforms/blackberry/qbbscreen.cpp +++ b/src/plugins/platforms/blackberry/qbbscreen.cpp @@ -351,4 +351,34 @@ void QBBScreen::removeOverlayWindow(screen_window_t window) updateHierarchy(); } +void QBBScreen::activateWindowGroup(const QByteArray &id) +{ +#if defined(QBBSCREEN_DEBUG) + qDebug() << Q_FUNC_INFO; +#endif + + if (!rootWindow() || id != rootWindow()->groupName()) + return; + + if (!mChildren.isEmpty()) { + // We're picking up the last window of the list here + // because this list is ordered by stacking order. + // Last window is effectively the one on top. + QWidget * const window = mChildren.last()->widget(); + QWindowSystemInterface::handleWindowActivated(window); + } +} + +void QBBScreen::deactivateWindowGroup(const QByteArray &id) +{ +#if defined(QBBSCREEN_DEBUG) + qDebug() << Q_FUNC_INFO; +#endif + + if (!rootWindow() || id != rootWindow()->groupName()) + return; + + QWindowSystemInterface::handleWindowActivated(0); +} + QT_END_NAMESPACE diff --git a/src/plugins/platforms/blackberry/qbbscreen.h b/src/plugins/platforms/blackberry/qbbscreen.h index e353de1..3d67b69 100644 --- a/src/plugins/platforms/blackberry/qbbscreen.h +++ b/src/plugins/platforms/blackberry/qbbscreen.h @@ -88,6 +88,8 @@ public Q_SLOTS: void setRotation(int rotation); void newWindowCreated(screen_window_t window); void windowClosed(screen_window_t window); + void activateWindowGroup(const QByteArray &id); + void deactivateWindowGroup(const QByteArray &id); private Q_SLOTS: void keyboardHeightChanged(int height); |