[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.
This commit is contained in:
parent
e46ad2091b
commit
280075b7cd
2 changed files with 9 additions and 1 deletions
|
@ -147,7 +147,7 @@ NET::WindowType ShellClient::windowType(bool direct, int supported_types) const
|
||||||
// TODO: implement
|
// TODO: implement
|
||||||
Q_UNUSED(direct)
|
Q_UNUSED(direct)
|
||||||
Q_UNUSED(supported_types)
|
Q_UNUSED(supported_types)
|
||||||
return NET::Normal;
|
return m_windowType;
|
||||||
}
|
}
|
||||||
|
|
||||||
double ShellClient::opacity() const
|
double ShellClient::opacity() const
|
||||||
|
@ -420,6 +420,13 @@ void ShellClient::findInternalWindow()
|
||||||
m_internalWindow = w;
|
m_internalWindow = w;
|
||||||
connect(m_internalWindow, &QWindow::xChanged, this, &ShellClient::updateInternalWindowGeometry);
|
connect(m_internalWindow, &QWindow::xChanged, this, &ShellClient::updateInternalWindowGeometry);
|
||||||
connect(m_internalWindow, &QWindow::yChanged, 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<NET::WindowType>(windowType.toInt());
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -129,6 +129,7 @@ private:
|
||||||
bool m_unmapped = true;
|
bool m_unmapped = true;
|
||||||
MaximizeMode m_maximizeMode = MaximizeRestore;
|
MaximizeMode m_maximizeMode = MaximizeRestore;
|
||||||
QRect m_geomMaximizeRestore; // size and position of the window before it was set to maximize
|
QRect m_geomMaximizeRestore; // size and position of the window before it was set to maximize
|
||||||
|
NET::WindowType m_windowType = NET::Normal;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue