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-24 17:58:33 +0300 |
commit | 69e06e2773bc61f116dc7c1de68f8efee4c2f333 (patch) | |
tree | 803d0940d702603b145547b262d2b544b10681b6 | |
parent | d675319c068825b181c01994bf49c286437dacf8 (diff) |
Remove windowmanager depends
Bug-AGL: SPEC-3447
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ic261b03eb51f874d5c6cfeeeece0f5d77d0eca98
-rw-r--r-- | app/app.pri | 2 | ||||
-rw-r--r-- | app/main.cpp | 37 | ||||
-rw-r--r-- | app/main.qml | 9 | ||||
-rw-r--r-- | package/config.xml | 1 |
4 files changed, 9 insertions, 40 deletions
diff --git a/app/app.pri b/app/app.pri index dd85f52..298b8e8 100644 --- a/app/app.pri +++ b/app/app.pri @@ -5,7 +5,7 @@ load(configure) qtCompileTest(libhomescreen) CONFIG += link_pkgconfig -PKGCONFIG += libhomescreen qlibwindowmanager qtappfw-core +PKGCONFIG += libhomescreen qtappfw-core config_libhomescreen { CONFIG += link_pkgconfig 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(); } diff --git a/app/main.qml b/app/main.qml index 2f6bda3..e4a6b60 100644 --- a/app/main.qml +++ b/app/main.qml @@ -5,6 +5,8 @@ import QtQuick.Layouts 1.1 import TaskManager 1.0 import QtCharts 2.2 +import QtQuick.Window 2.13 + ApplicationWindow { id: root visible: true @@ -63,9 +65,10 @@ ApplicationWindow { Item { id: container anchors.centerIn: parent - width: 1080 - height: 1487 - scale: screenInfo.scale_factor() + width: Screen.width + height: Screen.height + //scale: screenInfo.scale_factor() + scale: 1 TabView { id: mainTabview diff --git a/package/config.xml b/package/config.xml index 35ffe51..61d92f3 100644 --- a/package/config.xml +++ b/package/config.xml @@ -15,7 +15,6 @@ <feature name="urn:AGL:widget:required-api"> <param name="taskmanager" value="ws" /> - <param name="windowmanager" value="ws" /> <param name="homescreen" value="ws" /> </feature> </widget> |