File indexing completed on 2024-03-24 17:02:36

0001 /*
0002     SPDX-FileCopyrightText: 2015 Bhushan Shah <bhush94@gmail.com>
0003 
0004 SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #include "waylandlocker.h"
0008 
0009 #include <QGuiApplication>
0010 #include <QScreen>
0011 
0012 namespace ScreenLocker
0013 {
0014 WaylandLocker::WaylandLocker(QObject *parent)
0015     : AbstractLocker(parent)
0016 {
0017     if (m_background) {
0018         updateGeometryOfBackground();
0019         const auto screens = qApp->screens();
0020         for (auto s : screens) {
0021             connect(s, &QScreen::geometryChanged, this, &WaylandLocker::updateGeometryOfBackground);
0022         }
0023         connect(qApp, &QGuiApplication::screenAdded, this, [this](QScreen *s) {
0024             connect(s, &QScreen::geometryChanged, this, &WaylandLocker::updateGeometryOfBackground);
0025             updateGeometryOfBackground();
0026         });
0027         connect(qApp, &QGuiApplication::screenRemoved, this, &WaylandLocker::updateGeometryOfBackground);
0028     }
0029 }
0030 
0031 WaylandLocker::~WaylandLocker()
0032 {
0033 }
0034 
0035 void WaylandLocker::updateGeometryOfBackground()
0036 {
0037     QRect combined;
0038     const auto screens = qApp->screens();
0039     for (auto s : screens) {
0040         combined = combined.united(s->geometry());
0041     }
0042     m_background->setGeometry(combined);
0043     m_background->update();
0044 }
0045 
0046 void WaylandLocker::showLockWindow()
0047 {
0048 }
0049 
0050 void WaylandLocker::hideLockWindow()
0051 {
0052 }
0053 
0054 void WaylandLocker::addAllowedWindow(quint32 window)
0055 {
0056     Q_UNUSED(window)
0057     Q_EMIT lockWindowShown();
0058 }
0059 
0060 void WaylandLocker::stayOnTop()
0061 {
0062 }
0063 
0064 }