summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/app.pri2
-rw-r--r--app/main.cpp37
-rw-r--r--app/main.qml9
3 files changed, 9 insertions, 39 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