-
Notifications
You must be signed in to change notification settings - Fork 0
/
VirtualKeyboardManagerV1.cpp
46 lines (36 loc) · 1.29 KB
/
VirtualKeyboardManagerV1.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
42
43
44
45
46
#include "VirtualKeyboardManagerV1.h"
#include "VirtualKeyboardV1.h"
#include "qwayland-server-virtual-keyboard-unstable-v1.h"
#include <QWaylandKeymap>
#include <QWaylandSeat>
class VirtualKeyboardManagerV1Private : public QtWaylandServer::zwp_virtual_keyboard_manager_v1
{
public:
VirtualKeyboardManagerV1Private(VirtualKeyboardManagerV1 *q)
: q(q)
{
}
protected:
void zwp_virtual_keyboard_manager_v1_create_virtual_keyboard(Resource *resource,
struct ::wl_resource *seat,
uint32_t id) override
{
auto *s = QWaylandSeat::fromSeatResource(seat);
auto iter = q->m_virtualKeyboards.find(seat);
if (iter == q->m_virtualKeyboards.end()) {
auto *vk = new VirtualKeyboardV1(seat, q);
auto [i, r] = q->m_virtualKeyboards.emplace(seat, vk);
iter = i;
}
iter->second->add(resource->client(), id);
}
private:
VirtualKeyboardManagerV1 *q;
};
VirtualKeyboardManagerV1::VirtualKeyboardManagerV1(QObject *paernt)
: QObject(paernt)
, d(new VirtualKeyboardManagerV1Private(this))
{
}
VirtualKeyboardManagerV1::~VirtualKeyboardManagerV1() { }
INIT_FUNCS(VirtualKeyboardManagerV1)