summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaud Vrac <avrac@freebox.fr>2015-03-13 15:46:44 +0100
committerArnaud Vrac <avrac@freebox.fr>2015-05-07 08:44:11 +0000
commitca803d44c8231ff6262221a8d66c1401165f1171 (patch)
tree6f139b3da3210f92dfa562a3a46d3f493e1f4bac
parent578c2a0f0bdc14af14745496b3dc10b06a98b0b4 (diff)
Track last input window with a QPointer in case it is destroyed
Change-Id: I61d7aa4b6a37922eb3beefd983154ee267cae0ef Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
-rw-r--r--src/client/qwaylanddisplay.cpp5
-rw-r--r--src/client/qwaylanddisplay_p.h5
2 files changed, 8 insertions, 2 deletions
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp
index b985f10e5..e0155fc95 100644
--- a/src/client/qwaylanddisplay.cpp
+++ b/src/client/qwaylanddisplay.cpp
@@ -375,6 +375,11 @@ bool QWaylandDisplay::supportsWindowDecoration() const
return integrationSupport;
}
+QWaylandWindow *QWaylandDisplay::lastInputWindow() const
+{
+ return mLastInputWindow.data();
+}
+
void QWaylandDisplay::setLastInputDevice(QWaylandInputDevice *device, uint32_t serial, QWaylandWindow *win)
{
mLastInputDevice = device;
diff --git a/src/client/qwaylanddisplay_p.h b/src/client/qwaylanddisplay_p.h
index 4549d52e6..7ba431d7c 100644
--- a/src/client/qwaylanddisplay_p.h
+++ b/src/client/qwaylanddisplay_p.h
@@ -36,6 +36,7 @@
#include <QtCore/QObject>
#include <QtCore/QRect>
+#include <QtCore/QPointer>
#include <QtCore/QWaitCondition>
@@ -157,7 +158,7 @@ public:
uint32_t lastInputSerial() const { return mLastInputSerial; }
QWaylandInputDevice *lastInputDevice() const { return mLastInputDevice; }
- QWaylandWindow *lastInputWindow() const { return mLastInputWindow; }
+ QWaylandWindow *lastInputWindow() const;
void setLastInputDevice(QWaylandInputDevice *device, uint32_t serial, QWaylandWindow *window);
public slots:
@@ -202,7 +203,7 @@ private:
int mCompositorVersion;
uint32_t mLastInputSerial;
QWaylandInputDevice *mLastInputDevice;
- QWaylandWindow *mLastInputWindow;
+ QPointer<QWaylandWindow> mLastInputWindow;
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;