-
Notifications
You must be signed in to change notification settings - Fork 2
/
linuxcsd.h
31 lines (25 loc) · 871 Bytes
/
linuxcsd.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
#pragma once
#include <QObject>
#include <functional>
#include <unordered_map>
namespace CSD::Internal {
class LinuxClientSideDecorationFilter : public QObject {
Q_OBJECT
private:
using Callback = std::function<void()>;
struct WidgetCallbacks {
Callback onActivationChanged;
Callback onWindowStateChanged;
WidgetCallbacks(Callback onActivationChanged,
Callback onWindowStateChanged);
};
std::unordered_map<QWidget *, WidgetCallbacks> m_callbacks;
public:
explicit LinuxClientSideDecorationFilter(QObject *parent = nullptr);
~LinuxClientSideDecorationFilter() override;
bool eventFilter(QObject *watched, QEvent *event) override;
void apply(QWidget *widget,
Callback onActivationChanged,
Callback onWindowStateChanged);
};
} // namespace CSD::Internal