-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxcbthread.cpp
38 lines (31 loc) · 1011 Bytes
/
xcbthread.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
#include "xcbthread.h"
#include <QDebug>
XcbThread::XcbThread(QObject *parent) : QThread(parent)
{
}
XcbThread::~XcbThread()
{
}
void XcbThread::run()
{
if (xcb_test.deploy() < 0) {
qWarning() << "Error connecting to X";
return;
}
connect(&xcb_test, &xcb_get::windowCreated_houtai, this, [this](xcb_window_t window, const char *name) {
emit windowInfoChanged_houtai(QString(name), window);
});
connect(&xcb_test, &xcb_get::windowCreated_qiantai, this, [this](xcb_window_t window, const char *name) {
emit windowInfoChanged_qiantai(QString(name), window);
});
xcb_test.get_all_windows();
connect(&xcb_test, &xcb_get::windowCreated, this, [this](xcb_window_t window, const char *name) {
emit windowInfoChanged(QString(name), window);
});
connect(&xcb_test, &xcb_get::windowDestroyed, this, [this](xcb_window_t window) {
emit windowDestroyChanged(window);
});
for (;;) {
xcb_test.events_loop();
}
}