diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2019-02-14 13:41:30 +0100 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2019-02-20 14:13:05 +0000 |
commit | eb66211ea9b58537a21630893229c7d3c86a10b3 (patch) | |
tree | d3597596dbde8538727792b179453f9233a70725 /src/client/qwaylandinputdevice_p.h | |
parent | cf378b581009b80510cf54c8b56d4c2d950c1153 (diff) |
Client: Don't leak wl_data_offers
[ChangeLog][QPA plugin] Fixed a leak of wl_data_offers.
Data offers would previously leak when a surface with keyboard focus was
destroyed... or if it was hidden... or if it changed type, and so on.
Make keyboard focus follow a wl_surface instead of a QWaylandWindow.
This also fixes a couple of other minor issues, such as the mRepeatTimer not
stopping when a wl_surface was destroyed.
Ideally, we would have a QWaylandSurface class separate from the
QWaylandWindow, but that's out of scope for this fix.
Fixes: QTBUG-73825
Change-Id: I56e502512c3959e3fcdb63744adc4a7698e3d53d
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/client/qwaylandinputdevice_p.h')
-rw-r--r-- | src/client/qwaylandinputdevice_p.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/client/qwaylandinputdevice_p.h b/src/client/qwaylandinputdevice_p.h index e57d7f4fd..cb382da31 100644 --- a/src/client/qwaylandinputdevice_p.h +++ b/src/client/qwaylandinputdevice_p.h @@ -113,7 +113,6 @@ public: #if QT_CONFIG(cursor) void setCursor(const QCursor *cursor, const QSharedPointer<QWaylandBuffer> &cachedBuffer = {}, int fallbackOutputScale = 1); #endif - void handleWindowDestroyed(QWaylandWindow *window); void handleEndDrag(); #if QT_CONFIG(wayland_datadevice) @@ -193,7 +192,7 @@ public: Keyboard(QWaylandInputDevice *p); ~Keyboard() override; - void stopRepeat(); + QWaylandWindow *focusWindow() const; void keyboard_keymap(uint32_t format, int32_t fd, @@ -213,7 +212,7 @@ public: void keyboard_repeat_info(int32_t rate, int32_t delay) override; QWaylandInputDevice *mParent = nullptr; - QPointer<QWaylandWindow> mFocus; + ::wl_surface *mFocus = nullptr; #if QT_CONFIG(xkbcommon) xkb_context *mXkbContext = nullptr; xkb_keymap *mXkbMap = nullptr; @@ -238,6 +237,8 @@ public: private slots: void repeatKey(); + void handleFocusDestroyed(); + void handleFocusLost(); private: #if QT_CONFIG(xkbcommon) |