diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2016-06-01 16:23:23 +0200 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2016-07-04 14:05:30 +0000 |
commit | f497a5bb87270174b8e0106b7eca1992d44ff15d (patch) | |
tree | 78c0a273b27de1dee2beed135cae18524a71f9e5 /src/client/qwaylanddisplay_p.h | |
parent | 00a65be5ae8e1253ed6fd1f2e1df745f4c319de5 (diff) |
Use xdg_shell configure events to determine active window
According to the xdg_shell protocol, the compositor is allowed to set multiple
active windows. Qt's model, however, allows only a single active window.
In order to map between the models, a list of the compositor's active windows
is kept in QWaylandDisplay in the order they were activated. Hence, the front
of this list will always be the most recently activated window, and it will be
mapped as Qt's active window.
Previously keyboard focus was used to determine the active window, this method
has been disabled for xdg_shell.
Functionality for delaying the call to
QWindowSystemInterface::handleWindowActivated has been moved from
QWaylandInputDevice::Keyboard to QWaylandDisplay so the implementations can
share the workaround.
Task-number: QTBUG-53702
Change-Id: I878151f9c52ed09a8d6571c6208920436c3ca8fc
Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
Diffstat (limited to 'src/client/qwaylanddisplay_p.h')
-rw-r--r-- | src/client/qwaylanddisplay_p.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/client/qwaylanddisplay_p.h b/src/client/qwaylanddisplay_p.h index adc012b53..237be5b78 100644 --- a/src/client/qwaylanddisplay_p.h +++ b/src/client/qwaylanddisplay_p.h @@ -48,6 +48,7 @@ #include <QtCore/QObject> #include <QtCore/QRect> #include <QtCore/QPointer> +#include <QtCore/QVector> #include <QtCore/QWaitCondition> @@ -168,6 +169,11 @@ public: QWaylandWindow *lastInputWindow() const; void setLastInputDevice(QWaylandInputDevice *device, uint32_t serial, QWaylandWindow *window); + bool shellManagesActiveState() const; + void handleWindowActivated(QWaylandWindow *window); + void handleWindowDeactivated(QWaylandWindow *window); + void handleKeyboardFocusChanged(QWaylandInputDevice *inputDevice); + public slots: void blockingReadEvents(); void flushRequests(); @@ -177,6 +183,9 @@ private: void exitWithError(); void checkError() const; + void handleWaylandSync(); + void requestWaylandSync(); + struct Listener { RegistryListener listener; void *data; @@ -207,6 +216,10 @@ private: uint32_t mLastInputSerial; QWaylandInputDevice *mLastInputDevice; QPointer<QWaylandWindow> mLastInputWindow; + QWaylandWindow *mLastKeyboardFocus; + QVector<QWaylandWindow *> mActiveWindows; + struct wl_callback *mSyncCallback; + static const wl_callback_listener syncCallbackListener; void registry_global(uint32_t id, const QString &interface, uint32_t version) Q_DECL_OVERRIDE; void registry_global_remove(uint32_t id) Q_DECL_OVERRIDE; |