summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@qt.io>2016-08-26 16:22:11 +0200
committerPaul Olav Tvete <paul.tvete@qt.io>2016-08-26 16:23:35 +0200
commitf21246748ce20cd86346e192fe0c4c76a9b08a7c (patch)
treeae980082826dd72ac3d31461365f6a37e7c5265b
parent54b819679cd39e997cc9319deaf432c37667ae6f (diff)
parent93c09bcafbc6f2accd11d34433dc475822ba7712 (diff)
Merge remote-tracking branch 'qt/5.6.2' into 5.6
-rw-r--r--src/client/qwaylanddisplay.cpp17
-rw-r--r--src/client/qwaylandwindow.cpp5
-rw-r--r--src/client/qwaylandwindow_p.h2
3 files changed, 17 insertions, 7 deletions
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp
index 7225d24a..ae28eb77 100644
--- a/src/client/qwaylanddisplay.cpp
+++ b/src/client/qwaylanddisplay.cpp
@@ -399,13 +399,16 @@ void QWaylandDisplay::handleKeyboardFocusChanged(QWaylandInputDevice *inputDevic
{
QWaylandWindow *keyboardFocus = inputDevice->keyboardFocus();
- if (!keyboardFocus->shellSurface()->shellManagesActiveState() && mLastKeyboardFocus != keyboardFocus) {
- if (keyboardFocus)
- handleWindowActivated(keyboardFocus);
- if (mLastKeyboardFocus)
- handleWindowDeactivated(mLastKeyboardFocus);
- }
- mLastKeyboardFocus = inputDevice->keyboardFocus();
+ if (mLastKeyboardFocus == keyboardFocus)
+ return;
+
+ if (keyboardFocus && !keyboardFocus->shellManagesActiveState())
+ handleWindowActivated(keyboardFocus);
+
+ if (mLastKeyboardFocus && !mLastKeyboardFocus->shellManagesActiveState())
+ handleWindowDeactivated(mLastKeyboardFocus);
+
+ mLastKeyboardFocus = keyboardFocus;
}
void QWaylandDisplay::handleWaylandSync()
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index aba67653..8885c0e5 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -500,6 +500,11 @@ QWaylandSubSurface *QWaylandWindow::subSurfaceWindow() const
return mSubSurfaceWindow;
}
+bool QWaylandWindow::shellManagesActiveState() const
+{
+ return mShellSurface && mShellSurface->shellManagesActiveState();
+}
+
void QWaylandWindow::handleContentOrientationChange(Qt::ScreenOrientation orientation)
{
if (mDisplay->compositorVersion() < 2)
diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h
index c60891d4..d7e79515 100644
--- a/src/client/qwaylandwindow_p.h
+++ b/src/client/qwaylandwindow_p.h
@@ -136,6 +136,8 @@ public:
QWaylandSubSurface *subSurfaceWindow() const;
QWaylandScreen *screen() const { return mScreen; }
+ bool shellManagesActiveState() const;
+
void handleContentOrientationChange(Qt::ScreenOrientation orientation) Q_DECL_OVERRIDE;
void setOrientationMask(Qt::ScreenOrientations mask);