-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpwl.cpp
41 lines (34 loc) · 794 Bytes
/
pwl.cpp
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
#include "pwl.h"
#include "wintools.h"
#include <QDebug>
#include <KF5/KWindowSystem/KWindowSystem>
LDA_BEGIN_NAMESPACE
PWL::PWL(QObject *parent) : QObject(parent)
{
connect(KWindowSystem::self(), &KWindowSystem::windowAdded, this, [this](WId id) {
if (isFromPID((int)id, m_pid)){
m_ids << (int)id;
Q_EMIT windowAdded((int)id);
}
});
connect(KWindowSystem::self(), &KWindowSystem::windowRemoved, this, [this](WId id) {
if (m_ids.contains((int)id)) {
Q_EMIT windowRemoved((int)id);
m_ids.removeAll((int)id);
}
});
}
PWL::~PWL()
{
m_ids.~QList();
}
void PWL::setPID(int pid)
{
m_pid = pid;
m_ids = pidToWins(pid);
}
QList<int> PWL::WinIDs()
{
return m_ids;
}
LDA_END_NAMESPACE