diff options
author | Kazumasa Mitsunari <knimitz@witz-inc.co.jp> | 2018-11-15 20:33:37 +0900 |
---|---|---|
committer | Kazumasa Mitsunari <knimitz@witz-inc.co.jp> | 2018-11-15 20:33:37 +0900 |
commit | 06a1ce1a8dcc5cd7c2cb66e734ac45c5b106267f (patch) | |
tree | 5191ec180427a08ba0a6780b598057a26d8176bf /app | |
parent | e78714dea41d52c7c076cdae8527e984615823ad (diff) |
Modify graphic roleguppy_6.99.2guppy_6.99.1guppy/6.99.2guppy/6.99.16.99.26.99.1
Window Manager set role name as lower_case,
then change role as lower_case.
Bug-AGL: SPEC-1754
Change-Id: I77c3c875ff92949275fd35feb5274009342ac2c0
Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
Diffstat (limited to 'app')
-rw-r--r-- | app/main.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/app/main.cpp b/app/main.cpp index e830e38..fab15e8 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -31,7 +31,7 @@ int main(int argc, char *argv[]) { - QString myname = QString("Radio"); + QString graphic_role = QString("radio"); QGuiApplication app(argc, argv); @@ -101,27 +101,27 @@ int main(int argc, char *argv[]) AGLScreenInfo screenInfo(qwm->get_scale_factor()); engine.rootContext()->setContextProperty(QStringLiteral("screenInfo"), &screenInfo); // Request a surface as described in layers.json windowmanager’s file - if (qwm->requestSurface(myname) != 0) { + 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, myname](json_object *object) { + qwm->set_event_handler(QLibWindowmanager::Event_SyncDraw, [qwm, &graphic_role](json_object *object) { fprintf(stderr, "Surface got syncDraw!\n"); - qwm->endDraw(myname); + 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, myname](json_object *object){ - qDebug("Surface %s got tapShortcut\n", myname.toStdString().c_str()); - qwm->activateSurface(myname); + 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); }); engine.load(QUrl(QStringLiteral("qrc:/Radio.qml"))); QObject *root = engine.rootObjects().first(); QQuickWindow *window = qobject_cast<QQuickWindow *>(root); - QObject::connect(window, SIGNAL(frameSwapped()), qwm, SLOT(slotActivateSurface() + QObject::connect(window, SIGNAL(frameSwapped()), qwm, SLOT(slotActivateWindow() )); } return app.exec(); |