From 280075b7cdb3a9a43ea090947d3da78cf16e1528 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 8 Jun 2015 21:27:55 +0200 Subject: [PATCH] [wayland] Support windowType for internal windows Our internal windows (e.g. a declarative script) can specify their own window type which then can get honored by KWin. --- shell_client.cpp | 9 ++++++++- shell_client.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/shell_client.cpp b/shell_client.cpp index 563b510a2f..8078a78eec 100644 --- a/shell_client.cpp +++ b/shell_client.cpp @@ -147,7 +147,7 @@ NET::WindowType ShellClient::windowType(bool direct, int supported_types) const // TODO: implement Q_UNUSED(direct) Q_UNUSED(supported_types) - return NET::Normal; + return m_windowType; } double ShellClient::opacity() const @@ -420,6 +420,13 @@ void ShellClient::findInternalWindow() m_internalWindow = w; connect(m_internalWindow, &QWindow::xChanged, this, &ShellClient::updateInternalWindowGeometry); connect(m_internalWindow, &QWindow::yChanged, this, &ShellClient::updateInternalWindowGeometry); + + // Try reading the window type from the QWindow. PlasmaCore.Dialog provides a dynamic type property + // let's check whether it exists, if it does it's our window type + const QVariant windowType = m_internalWindow->property("type"); + if (!windowType.isNull()) { + m_windowType = static_cast(windowType.toInt()); + } return; } } diff --git a/shell_client.h b/shell_client.h index 49ebfa65ad..19c343c9e4 100644 --- a/shell_client.h +++ b/shell_client.h @@ -129,6 +129,7 @@ private: bool m_unmapped = true; MaximizeMode m_maximizeMode = MaximizeRestore; QRect m_geomMaximizeRestore; // size and position of the window before it was set to maximize + NET::WindowType m_windowType = NET::Normal; }; }