From 7f3aa5344ad5e2b336284fb95f140f3fe44a1f76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Tue, 28 Jun 2016 13:41:11 +0200 Subject: [PATCH] Set Tooltip window type on ToolTipDialog through KWindowSystem API In order to have support for tooltip window type in Wayland, the window type NET::Tooltip is also set through KWindowSystem API once the platform surface is created. REVIEW: 128300 --- src/declarativeimports/core/tooltipdialog.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/declarativeimports/core/tooltipdialog.cpp b/src/declarativeimports/core/tooltipdialog.cpp index 18aa520bf..28ba9beb1 100644 --- a/src/declarativeimports/core/tooltipdialog.cpp +++ b/src/declarativeimports/core/tooltipdialog.cpp @@ -22,8 +22,12 @@ #include #include #include +#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)) +#include +#endif #include +#include #include #if HAVE_X11 @@ -105,6 +109,15 @@ bool ToolTipDialog::event(QEvent *e) dismiss(); } +#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)) + if (e->type() == QEvent::PlatformSurface) { + auto pe = static_cast(e); + if (pe->surfaceEventType() == QPlatformSurfaceEvent::SurfaceCreated) { + KWindowSystem::setType(winId(), NET::Tooltip); + } + } +#endif + bool ret = Dialog::event(e); Qt::WindowFlags flags = Qt::ToolTip | Qt::WindowDoesNotAcceptFocus | Qt::WindowStaysOnTopHint; #if HAVE_X11