Add desiredScreen property to LayerShellQt::Window

If the property is set, the compositor will try to put the window on the
given output. If not set, the compositer will decide where to put the
window (usually the active output). The motivation for this change is the
ability for KRunner to always appear on the active output.
This commit is contained in:
Julius Zint
2022-01-21 13:29:46 +01:00
parent 14982d6dc7
commit 9f8b8c9731
3 changed files with 33 additions and 8 deletions

View File

@ -28,6 +28,7 @@ public:
Window::Layer layer = Window::LayerTop;
QMargins margins;
QWaylandLayerSurface *getSurface() const;
QPointer<QScreen> desiredOutput;
};
static QMap<QWindow *, Window *> s_map;
@ -113,6 +114,16 @@ Window::Layer Window::layer() const
return d->layer;
}
QScreen *Window::desiredOutput() const
{
return d->desiredOutput;
}
void Window::setDesiredOutput(QScreen *output)
{
d->desiredOutput = output;
}
Window::Window(QWindow *window)
: QObject(window)
, d(new WindowPrivate(window))