Replace Window::desiredOutput with a Window::screenConfiguration enum

To not overlap with QWindow::screen too much, introduce an enum to make it
more clear what the options and the resulting behaviour are.
This commit is contained in:
Fabian Vogt
2023-04-24 20:11:13 +00:00
committed by Vlad Zahorodnii
parent 511b92f4ab
commit 49f31bb22d
3 changed files with 20 additions and 20 deletions
+2 -3
View File
@@ -23,9 +23,8 @@ QWaylandLayerSurface::QWaylandLayerSurface(QtWayland::zwlr_layer_shell_v1 *shell
Q_ASSERT(interface);
wl_output *output = nullptr;
QScreen *screen = interface->desiredOutput();
if (screen) {
auto waylandScreen = dynamic_cast<QtWaylandClient::QWaylandScreen *>(screen->handle());
if (interface->screenConfiguration() == Window::ScreenFromQWindow) {
auto waylandScreen = dynamic_cast<QtWaylandClient::QWaylandScreen *>(window->window()->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
// this will not cast to a QWaylandScreen
if (!waylandScreen) {