summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKevin Ottens <kevin.ottens.qnx@kdab.com>2012-04-30 17:12:42 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-03 11:33:05 +0200
commitb6a4d69830c0d188b4f6c424808390dd8e3a90bc (patch)
tree847077305da270203e6a16e3f6f199df5b4d39c6 /src
parentf74e5a03598e102a1d81eb4fca58e41db713e5dc (diff)
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. Change-Id: Ide6779bd1288c6560d113c77c60fc0ae30866d7f Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/qnx/qqnxintegration.cpp2
-rw-r--r--src/plugins/platforms/qnx/qqnxscreen.cpp30
-rw-r--r--src/plugins/platforms/qnx/qqnxscreen.h2
3 files changed, 34 insertions, 0 deletions
diff --git a/src/plugins/platforms/qnx/qqnxintegration.cpp b/src/plugins/platforms/qnx/qqnxintegration.cpp
index 2fa3b45047..73d8cb2007 100644
--- a/src/plugins/platforms/qnx/qqnxintegration.cpp
+++ b/src/plugins/platforms/qnx/qqnxintegration.cpp
@@ -448,6 +448,8 @@ void QQnxIntegration::createDisplays()
screen, SLOT(windowClosed(void *)));
QObject::connect(m_navigatorEventHandler, SIGNAL(rotationChanged(int)), screen, SLOT(setRotation(int)));
+ QObject::connect(m_navigatorEventHandler, SIGNAL(windowGroupActivated(QByteArray)), screen, SLOT(activateWindowGroup(QByteArray)));
+ QObject::connect(m_navigatorEventHandler, SIGNAL(windowGroupDeactivated(QByteArray)), screen, SLOT(deactivateWindowGroup(QByteArray)));
}
}
diff --git a/src/plugins/platforms/qnx/qqnxscreen.cpp b/src/plugins/platforms/qnx/qqnxscreen.cpp
index 27c1357a87..ea0c9e340f 100644
--- a/src/plugins/platforms/qnx/qqnxscreen.cpp
+++ b/src/plugins/platforms/qnx/qqnxscreen.cpp
@@ -348,4 +348,34 @@ void QQnxScreen::windowClosed(void *window)
removeOverlayWindow(windowHandle);
}
+void QQnxScreen::activateWindowGroup(const QByteArray &id)
+{
+#if defined(QQNXSCREEN_DEBUG)
+ qDebug() << Q_FUNC_INFO;
+#endif
+
+ if (!rootWindow() || id != rootWindow()->groupName())
+ return;
+
+ if (!m_childWindows.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.
+ QWindow * const window = m_childWindows.last()->window();
+ QWindowSystemInterface::handleWindowActivated(window);
+ }
+}
+
+void QQnxScreen::deactivateWindowGroup(const QByteArray &id)
+{
+#if defined(QQNXSCREEN_DEBUG)
+ qDebug() << Q_FUNC_INFO;
+#endif
+
+ if (!rootWindow() || id != rootWindow()->groupName())
+ return;
+
+ QWindowSystemInterface::handleWindowActivated(0);
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/qnx/qqnxscreen.h b/src/plugins/platforms/qnx/qqnxscreen.h
index 272cdd6261..7816661323 100644
--- a/src/plugins/platforms/qnx/qqnxscreen.h
+++ b/src/plugins/platforms/qnx/qqnxscreen.h
@@ -94,6 +94,8 @@ public Q_SLOTS:
void setRotation(int rotation);
void newWindowCreated(void *window);
void windowClosed(void *window);
+ void activateWindowGroup(const QByteArray &id);
+ void deactivateWindowGroup(const QByteArray &id);
private Q_SLOTS:
void keyboardHeightChanged(int height);