diff options
author | Marius Vlad <marius.vlad@collabora.com> | 2020-05-15 13:18:35 +0300 |
---|---|---|
committer | Marius Vlad <marius.vlad@collabora.com> | 2020-06-12 16:05:56 +0300 |
commit | 64d6c8e707ba0c52b8fc473228ced1069c209a4f (patch) | |
tree | c6ef365c8690ba09e56d8bfeebe38d6fa2fb8cdf /app/main.cpp | |
parent | 7444efb947f28bf71ab4ce870012fe15adf30565 (diff) |
Remove windowmanager depends
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Diffstat (limited to 'app/main.cpp')
-rw-r--r-- | app/main.cpp | 37 |
1 files changed, 2 insertions, 35 deletions
diff --git a/app/main.cpp b/app/main.cpp index 9a3a1ce..0ed7df7 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -9,7 +9,6 @@ #include <QQmlApplicationEngine> #include <QApplication> #include <libhomescreen.hpp> -#include <qlibwindowmanager.h> #include <taskmanager.h> #include <unistd.h> @@ -17,9 +16,10 @@ int main(int argc, char *argv[]) { QString graphic_role = QString("utility"); - QString myname = QString("TaskManager"); + QString myname = QString("taskmanager"); QApplication app(argc, argv); + app.setDesktopFileName(myname); QCommandLineParser parser; parser.addPositionalArgument("port", app.translate("main", "port for binding")); @@ -51,39 +51,6 @@ int main(int argc, char *argv[]) context->setContextProperty(QStringLiteral("bindingAddress"), bindingAddress); qDebug() << "Connect to: " << bindingAddress; - std::string token = secret.toStdString(); - LibHomeScreen* hs = new LibHomeScreen(); - QLibWindowmanager* qwm = new QLibWindowmanager(); - - // WindowManager - if(qwm->init(port,secret) != 0) { - exit(EXIT_FAILURE); - } - AGLScreenInfo screenInfo(qwm->get_scale_factor()); - // Request a surface as described in layers.json windowmanager’s file - if (qwm->requestSurface(graphic_role) != 0) { - exit(EXIT_FAILURE); - } - // Create an event callback against an event type. Here a lambda is called when SyncDraw event occurs - qwm->set_event_handler(QLibWindowmanager::Event_SyncDraw, [qwm, &graphic_role](json_object *object) { - fprintf(stderr, "Surface got syncDraw!\n"); - qwm->endDraw(graphic_role); - }); - - // HomeScreen - hs->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, &graphic_role](json_object *object){ - qDebug("Surface %s got tapShortcut\n", graphic_role.toStdString().c_str()); - qwm->activateWindow(graphic_role); - }); - - context->setContextProperty(QStringLiteral("screenInfo"), &screenInfo); - engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); - QObject *root = engine.rootObjects().first(); - QQuickWindow *window = qobject_cast<QQuickWindow *>(root); - QObject::connect(window, SIGNAL(frameSwapped()), qwm, SLOT(slotActivateWindow() - )); return app.exec(); } |