/
main.cpp
42 lines (33 loc) · 939 Bytes
/
main.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
/*
* main.cpp
*
* Copyright (C) Johan Malm 2014
*/
#include <QApplication>
#include <QDebug>
#include <QScreen>
#include "x11-event-filter.h"
#include "settings.h"
#include "panel.h"
#include "settings.h"
int main(int argv, char **args)
{
QApplication app(argv, args);
QCoreApplication::setOrganizationName("unleash-panel");
QCoreApplication::setApplicationName("unleash");
initSettings();
/*
* GTK+ style creates a border around the window. I cannot find the
* stylesheet property associated with this, so force Fusion style to
* avoid the issue.
*/
app.setStyle("Fusion");
EventFilter filter;
app.installNativeEventFilter(&filter);
/* Create QGraphicsView - which is also the main window */
Panel panel;
panel.show();
QObject::connect(&filter, &EventFilter::caughtEvent, &panel, &Panel::reactToX11Event);
return app.exec();
}
// vim: set ts=4 sw=4 et: