2016-06-11 17:07:36 +10:00
|
|
|
#ifndef NATIVEEVENTFILTER_H
|
|
|
|
#define NATIVEEVENTFILTER_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QAbstractNativeEventFilter>
|
|
|
|
#include <xcb/xcb.h>
|
|
|
|
#include <xcb/xcb_atom.h>
|
|
|
|
#include <QX11Info>
|
2016-06-13 21:40:01 +10:00
|
|
|
#include <QProcess>
|
|
|
|
#include <QTime>
|
|
|
|
#include <math.h>
|
|
|
|
#include <QIcon>
|
|
|
|
#include "hotkeyhud.h"
|
|
|
|
#include "endsessionwait.h"
|
2016-06-21 17:42:44 +10:00
|
|
|
#include "dbusevents.h"
|
2016-06-30 16:07:29 +10:00
|
|
|
#include "rundialog.h"
|
2016-06-13 21:40:01 +10:00
|
|
|
#include <QDBusUnixFileDescriptor>
|
|
|
|
#include <QDBusMessage>
|
|
|
|
#include <QDBusConnection>
|
|
|
|
#include <QDBusReply>
|
|
|
|
#include <QDebug>
|
|
|
|
#include <QMessageBox>
|
2016-06-21 17:42:44 +10:00
|
|
|
#include <QSoundEffect>
|
2016-07-03 23:07:04 +10:00
|
|
|
#include "mainwindow.h"
|
2016-12-20 12:18:23 +11:00
|
|
|
#include "screenshotwindow.h"
|
2016-06-13 21:40:01 +10:00
|
|
|
|
|
|
|
#include <X11/XF86keysym.h>
|
2016-06-16 20:53:49 +10:00
|
|
|
#include <X11/keysym.h>
|
2016-06-13 21:40:01 +10:00
|
|
|
#include <X11/Xlib.h>
|
2016-06-11 17:07:36 +10:00
|
|
|
|
|
|
|
class NativeEventFilter : public QObject, public QAbstractNativeEventFilter
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit NativeEventFilter(QObject* parent = 0);
|
2016-06-13 21:40:01 +10:00
|
|
|
~NativeEventFilter();
|
2016-06-11 17:07:36 +10:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void SysTrayEvent(long opcode, long data2, long data3, long data4);
|
|
|
|
public slots:
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool nativeEventFilter(const QByteArray &eventType, void *message, long *result);
|
2016-06-13 21:40:01 +10:00
|
|
|
|
|
|
|
QTime lastPress;
|
|
|
|
HotkeyHud* Hotkeys;
|
2016-06-13 23:22:03 +10:00
|
|
|
|
|
|
|
bool isEndSessionBoxShowing = false;
|
2016-09-04 15:19:19 +10:00
|
|
|
bool ignoreSuper = false;
|
2016-09-08 20:57:34 +10:00
|
|
|
|
|
|
|
QSettings settings;
|
2016-06-11 17:07:36 +10:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // NATIVEEVENTFILTER_H
|