diff options
Diffstat (limited to 'app/main.cpp')
-rw-r--r-- | app/main.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/app/main.cpp b/app/main.cpp index 0330858..2a57d08 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 TOYOTA MOTOR CORPORATION + * Copyright (c) 2017 TOYOTA MOTOR CORPORATION * Copyright (C) 2016 The Qt Company Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -29,7 +29,7 @@ #include <QQuickWindow> #ifdef HAVE_LIBHOMESCREEN -#include <libhomescreen.hpp> +#include <qlibhomescreen.h> #endif #ifdef HAVE_QLIBWINDOWMANAGER #include <qlibwindowmanager.h> @@ -96,18 +96,21 @@ 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){ - qwm->activateSurface(myname, "split.main"); + qhs->set_event_handler(QLibHomeScreen::Event_ShowWindow, [qwm, myname](json_object *object){ + qwm->activateWindow(myname); }); #endif engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); QObject *root = engine.rootObjects().first(); QQuickWindow *window = qobject_cast<QQuickWindow *>(root); +#ifdef HAVE_LIBHOMESCREEN + qhs->setQuickWindow(window); +#endif #ifdef HAVE_QLIBWINDOWMANAGER // QObject::connect(window, SIGNAL(frameSwapped()), qwm, SLOT(slotActivateSurface())); |