From 8458e06b25c07ebc8cf6b210fc1ea4cc9aeb42eb Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Sat, 6 Sep 2014 22:55:07 +0200 Subject: Sanitize popup behavior. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Popups are pretty important for widget apps. Menus, combobox dropdows and such are all popups. Currently they are completely borked when activated via keyboard or touch. This is because of the bizarre set_popup request in the protocol, and Weston's current implementation, that ignore the fact that a popup can be opened as a result of a keyboard event too or may not originate from an input event at all. Pass the last input device and serial we have seen, regardless of the type, by tracking it globally in the QWaylandDisplay. With this patch menus and such will not freeze the application anymore when activated with keyboard or touch without sending a mouse event to the window first. The behavior is still broken in some ways, especially with keyboard due to immediately getting a popup_done, but at least applications remain usable. Task-number: QTBUG-41142 Task-number: QTBUG-41147 Change-Id: I18de501004ae8a62ff8667e72225d08c2d3ba491 Reviewed-by: Laszlo Agocs Reviewed-by: Jørgen Lind --- src/client/qwaylanddisplay_p.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/client/qwaylanddisplay_p.h') diff --git a/src/client/qwaylanddisplay_p.h b/src/client/qwaylanddisplay_p.h index 8d1d26bba..d9619e6f1 100644 --- a/src/client/qwaylanddisplay_p.h +++ b/src/client/qwaylanddisplay_p.h @@ -159,6 +159,11 @@ public: bool supportsWindowDecoration() const; + uint32_t lastInputSerial() const { return mLastInputSerial; } + QWaylandInputDevice *lastInputDevice() const { return mLastInputDevice; } + QWaylandWindow *lastInputWindow() const { return mLastInputWindow; } + void setLastInputDevice(QWaylandInputDevice *device, uint32_t serial, QWaylandWindow *window); + public slots: void blockingReadEvents(); void flushRequests(); @@ -200,6 +205,9 @@ private: bool mScreensInitialized; QList mGlobals; int mCompositorVersion; + uint32_t mLastInputSerial; + QWaylandInputDevice *mLastInputDevice; + 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; -- cgit v1.2.3