File indexing completed on 2024-05-12 17:10:20

0001 /*
0002     SPDX-FileCopyrightText: 2016 Marco Martin <mart@kde.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include <Plasma/Corona>
0010 #include <QPointer>
0011 #include <QWindow>
0012 
0013 class QScreen;
0014 
0015 class DesktopView : public QWindow
0016 {
0017     Q_OBJECT
0018 
0019 public:
0020     explicit DesktopView(Plasma::Corona *c, QScreen *targetScreen = nullptr);
0021     ~DesktopView() override;
0022 
0023     /*This is different from screen() as is always there, even if the window is
0024       temporarily outside the screen or if is hidden: only plasmashell will ever
0025       change this property, unlike QWindow::screen()*/
0026     void setScreenToFollow(QScreen *screen);
0027     QScreen *screenToFollow() const;
0028 
0029 private:
0030     QPointer<QScreen> m_screenToFollow;
0031 };