summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiulio Camuffo <giulio.camuffo@kdab.com>2017-07-03 08:19:58 +0200
committerGiulio Camuffo <giulio.camuffo@kdab.com>2017-07-12 14:17:36 +0000
commit6e2f628bedbe6dcbe5ac14614c4a30c8199af4f7 (patch)
tree6f0d64cb6aed7136a473bc174bf552d43e522476
parent6f3d69264b6640c94ecfdb89c4bbf90319534b09 (diff)
Use a non grabbing zxdg_popup_v6 for tooltips
Change-Id: I9de16c48a1dee7728fb02faa590c112bd656aa09 Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
-rw-r--r--src/client/qwaylandxdgshellv6.cpp10
-rw-r--r--src/client/qwaylandxdgshellv6_p.h2
2 files changed, 7 insertions, 5 deletions
diff --git a/src/client/qwaylandxdgshellv6.cpp b/src/client/qwaylandxdgshellv6.cpp
index 947940213..cd81778c7 100644
--- a/src/client/qwaylandxdgshellv6.cpp
+++ b/src/client/qwaylandxdgshellv6.cpp
@@ -163,8 +163,8 @@ void QWaylandXdgSurfaceV6::setAppId(const QString &appId)
void QWaylandXdgSurfaceV6::setType(Qt::WindowType type, QWaylandWindow *transientParent)
{
- if (type == Qt::Popup && transientParent) {
- setPopup(transientParent, m_window->display()->lastInputDevice(), m_window->display()->lastInputSerial());
+ if ((type == Qt::Popup || type == Qt::ToolTip) && transientParent) {
+ setPopup(transientParent, m_window->display()->lastInputDevice(), m_window->display()->lastInputSerial(), type == Qt::Popup);
} else {
setToplevel();
if (transientParent) {
@@ -189,7 +189,7 @@ void QWaylandXdgSurfaceV6::setToplevel()
m_toplevel = new Toplevel(this);
}
-void QWaylandXdgSurfaceV6::setPopup(QWaylandWindow *parent, QWaylandInputDevice *device, int serial)
+void QWaylandXdgSurfaceV6::setPopup(QWaylandWindow *parent, QWaylandInputDevice *device, int serial, bool grab)
{
Q_ASSERT(!m_toplevel && !m_popup);
@@ -209,7 +209,9 @@ void QWaylandXdgSurfaceV6::setPopup(QWaylandWindow *parent, QWaylandInputDevice
m_popup = new Popup(this, parentXdgSurface, positioner);
positioner->destroy();
delete positioner;
- m_popup->grab(device->wl_seat(), serial);
+ if (grab) {
+ m_popup->grab(device->wl_seat(), serial);
+ }
}
void QWaylandXdgSurfaceV6::zxdg_surface_v6_configure(uint32_t serial)
diff --git a/src/client/qwaylandxdgshellv6_p.h b/src/client/qwaylandxdgshellv6_p.h
index 12f7301d5..769f19837 100644
--- a/src/client/qwaylandxdgshellv6_p.h
+++ b/src/client/qwaylandxdgshellv6_p.h
@@ -121,7 +121,7 @@ private:
};
void setToplevel();
- void setPopup(QWaylandWindow *parent, QWaylandInputDevice *device, int serial);
+ void setPopup(QWaylandWindow *parent, QWaylandInputDevice *device, int serial, bool grab);
QWaylandXdgShellV6 *m_shell;
QWaylandWindow *m_window;