blob: 4e13eab8b591821ff09a3bc1917aa9c87ac73892 (
plain)
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
57
58
59
60
61
62
63
64
65
66
67
68
|
// Copyright 2007-2022 The Mumble Developers. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
#ifndef MUMBLE_MUMBLE_GLOBALSHORTCUT_UNIX_H_
#define MUMBLE_MUMBLE_GLOBALSHORTCUT_UNIX_H_
#include "ConfigDialog.h"
#include "Global.h"
#include "GlobalShortcut.h"
#include <X11/X.h>
#define NUM_BUTTONS 0x2ff
struct _XDisplay;
typedef _XDisplay Display;
class QFileSystemWatcher;
class QSocketNotifier;
class GlobalShortcutX : public GlobalShortcutEngine {
private:
Q_OBJECT
Q_DISABLE_COPY(GlobalShortcutX)
public:
Display *display;
QSet< Window > qsRootWindows;
int iXIopcode;
QSet< int > qsMasterDevices;
volatile bool bRunning;
QSet< QString > qsKeyboards;
QMap< QString, QFile * > qmInputDevices;
GlobalShortcutX();
~GlobalShortcutX() Q_DECL_OVERRIDE;
void run() Q_DECL_OVERRIDE;
ButtonInfo buttonInfo(const QVariant &) Q_DECL_OVERRIDE;
void queryXIMasterList();
bool canDisable() override;
bool enabled() override;
void setEnabled(bool enabled) override;
public slots:
void displayReadyRead(int);
void inputReadyRead(int);
void directoryChanged(const QString &);
protected:
bool m_enabled = true;
QFileSystemWatcher *m_watcher = nullptr;
QSocketNotifier *m_notifier = nullptr;
bool init();
void stop();
};
// These are macros that X11/X.h defines and that are causing problems in unity builds
// if left defined
#undef None
#undef KeyPress
#undef FontChange
#endif
|