-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
x11locker.h
56 lines (46 loc) · 1.39 KB
/
x11locker.h
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
50
51
52
53
54
55
56
/*
SPDX-FileCopyrightText: 1999 Martin R. Jones <[email protected]>
SPDX-FileCopyrightText: 2002 Luboš Luňák <[email protected]>
SPDX-FileCopyrightText: 2003 Oswald Buddenhagen <[email protected]>
SPDX-FileCopyrightText: 2008 Chani Armitage <[email protected]>
SPDX-FileCopyrightText: 2011 Martin Gräßlin <[email protected]>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include "abstractlocker.h"
#include <QAbstractNativeEventFilter>
#include <X11/Xlib.h>
#include <fixx11h.h>
namespace ScreenLocker
{
class AbstractLocker;
class X11Locker : public AbstractLocker, public QAbstractNativeEventFilter
{
Q_OBJECT
public:
explicit X11Locker(QObject *parent = nullptr);
~X11Locker() override;
void showLockWindow() override;
void hideLockWindow() override;
void addAllowedWindow(quint32 window) override;
bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result) override;
private Q_SLOTS:
void updateGeo();
private:
void initialize();
void saveVRoot();
void setVRoot(Window win, Window vr);
void removeVRoot(Window win);
int findWindowInfo(Window w);
void fakeFocusIn(WId window);
void stayOnTop() override;
struct WindowInfo {
Window window;
bool viewable;
};
QList<WindowInfo> m_windowInfo;
QList<WId> m_lockWindows;
QList<quint32> m_allowedWindows;
WId m_focusedLockWindow;
};
}