diff options
author | Marius Vlad <marius.vlad@collabora.com> | 2020-05-15 15:51:06 +0300 |
---|---|---|
committer | Marius Vlad <marius.vlad@collabora.com> | 2020-06-24 18:00:53 +0300 |
commit | f3ee268c94481fa1a60df5e8684a9ddf485f890c (patch) | |
tree | 520407c4bcad9839ae7ac52528b62eb7e12079cd /app/main.cpp | |
parent | ea5cae15deb6e8dbe1db8bfe389217cc26fbdfca (diff) |
app: Remove windowmanager deps
Bug-AGL: SPEC-3447
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ia608d28187b34690f93445c4bf0214a44cf1d5b2
Diffstat (limited to 'app/main.cpp')
-rw-r--r-- | app/main.cpp | 36 |
1 files changed, 2 insertions, 34 deletions
diff --git a/app/main.cpp b/app/main.cpp index 783d2f5..e7c0070 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -24,7 +24,6 @@ #include <QtQuickControls2/QQuickStyle> #include <QQuickWindow> #include <libhomescreen.hpp> -#include <qlibwindowmanager.h> #include <map.h> @@ -33,6 +32,7 @@ int main(int argc, char *argv[]) QString graphic_role = QString("messaging"); QGuiApplication app(argc, argv); + app.setDesktopFileName(graphic_role); QQuickStyle::setStyle("AGL"); @@ -45,6 +45,7 @@ int main(int argc, char *argv[]) parser.addVersionOption(); parser.process(app); QStringList positionalArguments = parser.positionalArguments(); + if (positionalArguments.length() == 2) { int port = positionalArguments.takeFirst().toInt(); QString secret = positionalArguments.takeFirst(); @@ -62,40 +63,7 @@ int main(int argc, char *argv[]) Map *map = new Map(bindingAddress, context); context->setContextProperty("messaging", map); - 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) { - Q_UNUSED(object); - qwm->endDraw(graphic_role); - }); - - // HomeScreen - hs->init(port, token.c_str()); - // Set the event handler for Event_ShowWindow which will activate the surface for windowmanager - hs->set_event_handler(LibHomeScreen::Event_ShowWindow, [qwm, &graphic_role](json_object *object){ - qDebug("Surface %s got showWindow\n", graphic_role.toStdString().c_str()); - qwm->activateWindow(graphic_role); - }); - - engine.rootContext()->setContextProperty("screenInfo", &screenInfo); engine.load(QUrl(QStringLiteral("qrc:/Messaging.qml"))); - QObject *root = engine.rootObjects().first(); - QQuickWindow *window = qobject_cast<QQuickWindow *>(root); - QObject::connect(window, SIGNAL(frameSwapped()), qwm, SLOT(slotActivateWindow() - )); } return app.exec(); } |