mirror of
https://invent.kde.org/plasma/layer-shell-qt.git
synced 2025-06-04 01:28:35 -04:00
Use the QScreen of the QWindow as default output
If no screen was explicitly assigned through the Window::setDesiredOutput API, use the QWindow's screen property. This allows assigning QWindows to specific screens using the plain Qt API.
This commit is contained in:
parent
b9f8f6447d
commit
8de885ad54
@ -25,6 +25,10 @@ QWaylandLayerSurface::QWaylandLayerSurface(QWaylandLayerShell *shell, QtWaylandC
|
||||
|
||||
wl_output *output = nullptr;
|
||||
QScreen *screen = interface->desiredOutput();
|
||||
if (!screen) {
|
||||
screen = window->window()->screen();
|
||||
}
|
||||
|
||||
if (screen) {
|
||||
auto waylandScreen = dynamic_cast<QtWaylandClient::QWaylandScreen *>(screen->handle());
|
||||
// Qt will always assign a screen to a window, but if the compositor has no screens available a dummy QScreen object is created
|
||||
|
Loading…
x
Reference in New Issue
Block a user