@@ -30,6 +30,7 @@ HomeKeyWatcher::HomeKeyWatcher(UnityUtil::AbstractTimer *timer,
30 QQuickItem *parent)
30 QQuickItem *parent)
31 : QQuickItem(parent)
31 : QQuickItem(parent)
32 , m_windowBeingTouched(false)
32 , m_windowBeingTouched(false)
33+ , m_homeKeyPressed(false)
33 , m_windowLastTouchedTimer(elapsedTimer)
34 , m_windowLastTouchedTimer(elapsedTimer)
34 , m_activationTimer(timer)
35 , m_activationTimer(timer)
@@ -66,12 +67,21 @@ void HomeKeyWatcher::update(QEvent *event)
66 if (event->type() == QEvent::KeyPress) {
67 if (event->type() == QEvent::KeyPress) {
67 QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
68 QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
70+ m_homeKeyPressed = true;
69 if (keyEvent->key() == Qt::Key_Super_L && !keyEvent->isAutoRepeat()
72 if (keyEvent->key() == Qt::Key_Super_L && !keyEvent->isAutoRepeat()
70 && !m_windowBeingTouched
73 && !m_windowBeingTouched
71 && m_windowLastTouchedTimer->elapsed() >= msecsWithoutTouches) {
74 && m_windowLastTouchedTimer->elapsed() >= msecsWithoutTouches) {
72 m_activationTimer->start();
75 m_activationTimer->start();
78+ } else if (event->type() == QEvent::KeyRelease) {
79+ QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
81+ if (keyEvent->key() == Qt::Key_Super_L) {
82+ m_homeKeyPressed = false;
75 } else if (event->type() == QEvent::TouchBegin) {
85 } else if (event->type() == QEvent::TouchBegin) {
77 m_activationTimer->stop();
87 m_activationTimer->stop();
@@ -99,7 +109,8 @@ void HomeKeyWatcher::setupFilterOnWindow(QQuickWindow *window)
100void HomeKeyWatcher::emitActivatedIfNoTouchesAround()
110void HomeKeyWatcher::emitActivatedIfNoTouchesAround()
112+ if (!m_homeKeyPressed && !m_windowBeingTouched &&
102− if (!m_windowBeingTouched && (m_windowLastTouchedTimer->elapsed() > msecsWithoutTouches)) {
113+ (m_windowLastTouchedTimer->elapsed() > msecsWithoutTouches)) {
103 Q_EMIT activated();
114 Q_EMIT activated();