diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2016-08-24 16:08:56 +0200 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2016-08-26 05:51:29 +0000 |
commit | 93c09bcafbc6f2accd11d34433dc475822ba7712 (patch) | |
tree | a6ddc0b07213e641b4358722ce61f4ad71de021e /src/client/qwaylandwindow.cpp | |
parent | 2cc758045e322873ad58f675a70c8d8366b5c318 (diff) |
Client: Fix keyboard focus logic and crash
The previous solution did not check for nullptr before dereferencing, which
caused a crash. Furthermore, it checked the new ShellSurface's
shellManagesActiveState before deciding whether to unfocus the old one.
Task-number: QTBUG-55526
Change-Id: I410b6200a5b7b86806f70970730045a4a25f21db
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/client/qwaylandwindow.cpp')
-rw-r--r-- | src/client/qwaylandwindow.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index aba676533..8885c0e5d 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) |