Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.8
-
None
-
Fedora 41, KDE Plasma
Description
Consider this QML code:
import QtQuick Window { screen: Qt.application.screens[0] Component.onCompleted: showFullScreen() Rectangle { color: "red" anchors.fill: parent } }
The goal is to show a fullscreen window on a particular screen.
However it does not work as expected. The window always opens on a specific screen, regardless of which screen index is picked.
This is caused by the lines https://invent.kde.org/qt/qt/qtbase/-/blob/dev/src/gui/kernel/qwindow.cpp#L562-563
if (QScreen *screen = screenForGeometry(geometry)) setTopLevelScreen(screen, false);
This is called after the initial setScreen from QML and overrides it. screenForGeometry() can't work on Wayland, so the result will be wrong.
It can be worked around by calling show() before setting the screen