aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/app.pri2
-rw-r--r--app/main.cpp31
2 files changed, 10 insertions, 23 deletions
diff --git a/app/app.pri b/app/app.pri
index a1f6562..3bd7b93 100644
--- a/app/app.pri
+++ b/app/app.pri
@@ -5,7 +5,7 @@ qtCompileTest(qlibwindowmanager)
config_libhomescreen {
CONFIG += link_pkgconfig
- PKGCONFIG += libhomescreen
+ PKGCONFIG += qlibhomescreen
DEFINES += HAVE_LIBHOMESCREEN
}
diff --git a/app/main.cpp b/app/main.cpp
index 6194c25..05eaf31 100644
--- a/app/main.cpp
+++ b/app/main.cpp
@@ -13,7 +13,7 @@
#include "file_operation.h"
#ifdef HAVE_LIBHOMESCREEN
-#include <libhomescreen.hpp>
+#include <qlibhomescreen.h>
#endif
#ifdef HAVE_QLIBWINDOWMANAGER
#include <qlibwindowmanager.h>
@@ -65,28 +65,13 @@ int main(int argc, char *argv[])
#ifdef HAVE_LIBHOMESCREEN
// HomeScreen
- LibHomeScreen* hs = new LibHomeScreen();
+ QLibHomeScreen* qhs = new QLibHomeScreen();
std::string token = secret.toStdString();
- hs->init(port, token.c_str());
+ qhs->init(port, token.c_str());
// Set the event handler for Event_TapShortcut which will activate the surface for windowmanager
- hs->set_event_handler(LibHomeScreen::Event_TapShortcut, [qwm, myname](json_object *object){
-
- json_object *appnameJ = nullptr;
- if(json_object_object_get_ex(object, "application_name", &appnameJ))
- {
- const char *appname = json_object_get_string(appnameJ);
- if(QString::compare(myname, appname, Qt::CaseInsensitive) == 0)
- {
- qDebug("Surface %s got tapShortcut\n", appname);
- json_object *para, *area;
- json_object_object_get_ex(object, "parameter", &para);
- json_object_object_get_ex(para, "area", &area);
- const char *displayArea = json_object_get_string(area);
- qDebug("Surface %s got tapShortcut area\n", displayArea);
-// qwm->activateWindow(myname, QString(QLatin1String(displayArea)));
- qwm->activateWindow(myname, "master.split.sub");
- }
- }
+ qhs->set_event_handler(QLibHomeScreen::Event_ShowWindow, [qwm, myname](json_object *object){
+ qDebug("Surface %s got tapShortcut\n", myname);
+ qwm->activateWindow(myname);
});
#endif
qmlRegisterType<QCheapRuler>("com.mapbox.cheap_ruler", 1, 0, "CheapRuler");
@@ -98,7 +83,9 @@ int main(int argc, char *argv[])
QObject *root = engine.rootObjects().first();
QQuickWindow *window = qobject_cast<QQuickWindow *>(root);
-
+#ifdef HAVE_LIBHOMESCREEN
+ qhs->setQuickWindow(window);
+#endif
//make the DBus connection info
QString pathBase = "org.agl.";
QString objBase = "/org/agl/";