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:
Fabian Vogt 2023-02-21 16:03:51 +01:00
parent b9f8f6447d
commit 8de885ad54

View File

@ -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