Hello everyone
I want to set a window’s scope use the LayerShellQt::setScope function in package layer-shell-qt. And here is the source code of setScope:
// layer-shell-qt code
void Window::setScope(const QString &scope)
{
d->scope = scope;
// this is static and must be set before the platform window is created
}
As the comment, setScope is static. But I don’t think that it’s a static function.
And here is my code:
// my demo code
if (auto layerShellWindow = LayerShellQt::Window::get(window->windowHandle())) {
qDebug() << "MMMMMM scope is " << layerShellWindow->scope();
layerShellWindow->setScope("screenlock");
qDebug() << "MMMMMM scope now is " << layerShellWindow->scope();
}
I can set the scope to “screenlock” successfully. But in KWin, It seems the scope is from another library(maybe wayland or kwayland-server, I’m not sure, only working on this for a few days) , and it seems that it has nothing to do with layer-shell-qt. So in this code of KWin, the scope is always “window”, which is the default scope in layer-shell-qt of class WindowPrivate.
// KWin code
LayerShellV1Client::LayerShellV1Client(LayerSurfaceV1Interface *shellSurface,
AbstractOutput *output,
LayerShellV1Integration *integration)
: WaylandClient(shellSurface->surface())
, m_desiredOutput(output)
, m_integration(integration)
, m_shellSurface(shellSurface)
, m_windowType(scopeToType(shellSurface->scope()))
{
In summary, how to use the setScope function in layer-shell-qt, is there a demo? Or is it wrong?
Thank you all! My respect