File: raiselockscreen.h

package info (click to toggle)
plasma-mobile 6.5.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 20,412 kB
  • sloc: xml: 38,474; cpp: 18,529; javascript: 139; sh: 82; makefile: 5
file content (49 lines) | stat: -rw-r--r-- 1,179 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// SPDX-FileCopyrightText: 2025 Devin Lin <devin@kde.org>
// SPDX-License-Identifier: LGPL-2.0-or-later

#pragma once

#include <QObject>
#include <QQuickWindow>
#include <QWindow>

#include "qqml.h"

class WaylandAboveLockscreen;

/**
 * A plugin to implement raising windows over the lockscreen.
 */
class RaiseLockscreen : public QObject
{
    Q_OBJECT
    Q_PROPERTY(QWindow *window READ window WRITE setWindow NOTIFY windowChanged)
    Q_PROPERTY(bool initialized READ initialized NOTIFY initializedChanged)
    QML_ELEMENT

public:
    RaiseLockscreen(QObject *parent = nullptr);
    ~RaiseLockscreen() override;

    QWindow *window() const;
    void setWindow(QWindow *window);

    bool initialized() const;

    Q_INVOKABLE void initializeOverlay(QQuickWindow *window);
    Q_INVOKABLE void raiseOverlay();

Q_SIGNALS:
    void windowChanged();
    void initializedChanged();

private:
    void setInitialized(bool initialized);
    void setOverlay();
    bool eventFilter(QObject *watched, QEvent *event) override;

    bool m_initialized = false;
    QWindow *m_window = nullptr;
    int m_serial = 0;
    std::unique_ptr<WaylandAboveLockscreen> m_implementation;
};