diff options
Diffstat (limited to 'src/compositor/compositor_api/qwaylandoutput.cpp')
-rw-r--r-- | src/compositor/compositor_api/qwaylandoutput.cpp | 73 |
1 files changed, 21 insertions, 52 deletions
diff --git a/src/compositor/compositor_api/qwaylandoutput.cpp b/src/compositor/compositor_api/qwaylandoutput.cpp index 601f692af..c19e2bd94 100644 --- a/src/compositor/compositor_api/qwaylandoutput.cpp +++ b/src/compositor/compositor_api/qwaylandoutput.cpp @@ -1,42 +1,6 @@ -/**************************************************************************** -** -** Copyright (C) 2017-2016 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> -** Copyright (C) 2017 Klarälvdalens Datakonsult AB (KDAB). -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2017-2016 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> +// Copyright (C) 2017 Klarälvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "qwaylandoutput.h" #include "qwaylandoutput_p.h" @@ -259,6 +223,7 @@ QWaylandOutput::QWaylandOutput() /*! \qmltype WaylandOutput + \instantiates QWaylandOutput \inqmlmodule QtWayland.Compositor \since 5.8 \brief Provides access to a displayable area managed by the compositor. @@ -268,6 +233,9 @@ QWaylandOutput::QWaylandOutput() a screen managed by the WaylandCompositor. The type corresponds to the \c wl_output interface in the Wayland protocol. + + \note If the compositor has multiple Wayland outputs, the \l Qt::AA_ShareOpenGLContexts + attribute must be set before the \l QGuiApplication object is constructed. */ /*! @@ -390,7 +358,7 @@ void QWaylandOutput::update() } /*! - * \qmlproperty WaylandCompositor QtWaylandCompositor::WaylandOutput::compositor + * \qmlproperty WaylandCompositor QtWayland.Compositor::WaylandOutput::compositor * * This property holds the compositor displaying content on this WaylandOutput. * @@ -430,7 +398,7 @@ void QWaylandOutput::setCompositor(QWaylandCompositor *compositor) } /*! - * \qmlproperty string QtWaylandCompositor::WaylandOutput::manufacturer + * \qmlproperty string QtWayland.Compositor::WaylandOutput::manufacturer * * This property holds a textual description of the manufacturer of this WaylandOutput. */ @@ -458,7 +426,7 @@ void QWaylandOutput::setManufacturer(const QString &manufacturer) } /*! - * \qmlproperty string QtWaylandCompositor::WaylandOutput::model + * \qmlproperty string QtWayland.Compositor::WaylandOutput::model * * This property holds a textual description of the model of this WaylandOutput. */ @@ -486,7 +454,7 @@ void QWaylandOutput::setModel(const QString &model) } /*! - * \qmlproperty point QtWaylandCompositor::WaylandOutput::position + * \qmlproperty point QtWayland.Compositor::WaylandOutput::position * * This property holds the position of this WaylandOutput in the compositor's coordinate system. */ @@ -538,7 +506,8 @@ void QWaylandOutput::addMode(const QWaylandOutputMode &mode, bool preferred) return; } - d->modes.append(mode); + if (d->modes.indexOf(mode) < 0) + d->modes.append(mode); if (preferred) d->preferredMode = d->modes.indexOf(mode); @@ -590,7 +559,7 @@ void QWaylandOutput::setCurrentMode(const QWaylandOutputMode &mode) } /*! - * \qmlproperty rect QtWaylandCompositor::WaylandOutput::geometry + * \qmlproperty rect QtWayland.Compositor::WaylandOutput::geometry * * This property holds the geometry of the WaylandOutput. */ @@ -609,7 +578,7 @@ QRect QWaylandOutput::geometry() const } /*! - * \qmlproperty rect QtWaylandCompositor::WaylandOutput::availableGeometry + * \qmlproperty rect QtWayland.Compositor::WaylandOutput::availableGeometry * * This property holds the geometry of the WaylandOutput available for displaying content. * The available geometry is in output coordinates space, starts from 0,0 and it's as big @@ -652,7 +621,7 @@ void QWaylandOutput::setAvailableGeometry(const QRect &availableGeometry) } /*! - * \qmlproperty size QtWaylandCompositor::WaylandOutput::physicalSize + * \qmlproperty size QtWayland.Compositor::WaylandOutput::physicalSize * * This property holds the physical size of the WaylandOutput in millimeters. * @@ -700,7 +669,7 @@ void QWaylandOutput::setPhysicalSize(const QSize &size) */ /*! - * \qmlproperty enum QtWaylandCompositor::WaylandOutput::subpixel + * \qmlproperty enum QtWayland.Compositor::WaylandOutput::subpixel * * This property holds the subpixel arrangement of this WaylandOutput. * @@ -757,7 +726,7 @@ void QWaylandOutput::setSubpixel(const Subpixel &subpixel) */ /*! - * \qmlproperty enum QtWaylandCompositor::WaylandOutput::transform + * \qmlproperty enum QtWayland.Compositor::WaylandOutput::transform * * This property holds the transformation that the QWaylandCompositor applies to a surface * to compensate for the orientation of the QWaylandOutput. @@ -803,7 +772,7 @@ void QWaylandOutput::setTransform(const Transform &transform) } /*! - * \qmlproperty int QtWaylandCompositor::WaylandOutput::scaleFactor + * \qmlproperty int QtWayland.Compositor::WaylandOutput::scaleFactor * * This property holds the factor by which the WaylandCompositor scales surface buffers * before they are displayed. It is used on high density output devices where unscaled content @@ -853,7 +822,7 @@ void QWaylandOutput::setScaleFactor(int scale) } /*! - * \qmlproperty bool QtWaylandCompositor::WaylandOutput::sizeFollowsWindow + * \qmlproperty bool QtWayland.Compositor::WaylandOutput::sizeFollowsWindow * * This property controls whether the size of the WaylandOutput matches the * size of its window. @@ -891,7 +860,7 @@ void QWaylandOutput::setSizeFollowsWindow(bool follow) } /*! - * \qmlproperty Window QtWaylandCompositor::WaylandOutput::window + * \qmlproperty Window QtWayland.Compositor::WaylandOutput::window * * This property holds the Window for this WaylandOutput. * |