summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2018-05-08 16:31:55 +0200
committerJohan Helsing <johan.helsing@qt.io>2018-05-09 09:55:24 +0000
commit7344822dd3991fa4b914531d7e2a42b1c05c1e9d (patch)
tree44e84db81a5f7441c0e69161607323ffb122fe9b /src
parent44f3b888a3f88ac8097ff65aec0101dbe6a369ef (diff)
Fix QWaylandXdgShellV6Integration::handleKeyboardFocusChanged
The implementation was broken because it: 1. Didn't activate popups. 2. Activated toplevels with keyboard focus twice. 3. Tried to cast to xdg-shell-v5 classes, so windows were never deactivated. Change-Id: If492ebdbcd10a3214424f7bf6ac01e7ba8704bbf Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/client/qwaylandxdgshellv6integration.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/client/qwaylandxdgshellv6integration.cpp b/src/client/qwaylandxdgshellv6integration.cpp
index d3327ff39..2713ac37b 100644
--- a/src/client/qwaylandxdgshellv6integration.cpp
+++ b/src/client/qwaylandxdgshellv6integration.cpp
@@ -41,9 +41,6 @@
#include <QtWaylandClient/private/qwaylandwindow_p.h>
#include <QtWaylandClient/private/qwaylanddisplay_p.h>
-#include <QtWaylandClient/private/qwaylandxdgsurface_p.h>
-#include <QtWaylandClient/private/qwaylandxdgpopup_p.h>
-#include <QtWaylandClient/private/qwaylandxdgshell_p.h>
#include <QtWaylandClient/private/qwaylandxdgshellv6_p.h>
QT_BEGIN_NAMESPACE
@@ -82,12 +79,12 @@ void QWaylandXdgShellV6Integration::handleKeyboardFocusChanged(QWaylandWindow *n
{
if (newFocus) {
auto *xdgSurface = qobject_cast<QWaylandXdgSurfaceV6 *>(newFocus->shellSurface());
- if (xdgSurface && xdgSurface->handlesActiveState())
+ if (xdgSurface && !xdgSurface->handlesActiveState())
m_display->handleWindowActivated(newFocus);
}
- if (oldFocus && qobject_cast<QWaylandXdgPopup *>(oldFocus->shellSurface())) {
+ if (oldFocus && qobject_cast<QWaylandXdgSurfaceV6 *>(oldFocus->shellSurface())) {
auto *xdgSurface = qobject_cast<QWaylandXdgSurfaceV6 *>(oldFocus->shellSurface());
- if (xdgSurface && xdgSurface->handlesActiveState())
+ if (xdgSurface && !xdgSurface->handlesActiveState())
m_display->handleWindowDeactivated(oldFocus);
}
}