X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=sample%2Fapp%2Fmain.qml;h=2979d88f97b2f1229c406839c61c1c9c98473fbc;hb=831dc2946ce773ce2ed944ea9253350e5dd081bb;hp=b9f415b0708edf81cb76607794aef7b63e9050cb;hpb=aee1b69e8e207081a3d8b2670980671a9fbc78b8;p=apps%2Fonscreenapp.git diff --git a/sample/app/main.qml b/sample/app/main.qml index b9f415b..2979d88 100644 --- a/sample/app/main.qml +++ b/sample/app/main.qml @@ -7,8 +7,8 @@ import AGL.Demo.Controls 1.0 ApplicationWindow { id: root visible: true - width: 1080 - height: 1487 + width: Screen.width + height: Screen.height property string onsId: qsTr("onscreenapp") property string onsTitle: qsTr("One Button title") @@ -19,6 +19,8 @@ ApplicationWindow { property string onsButton3: qsTr("") property string postmsg: qsTr("") property string btndata: qsTr("") + property int pid: -1 + property bool onscreen_role_set: false Label { id: title @@ -339,7 +341,20 @@ ApplicationWindow { else postmsg += "}" - eventHandler.showWindow(onsId, postmsg); + if (!onscreen_role_set) { + eventHandler.set_window_poup(onsId, 0, 218) + onscreen_role_set = true + } + + // if the application is not already started, start it + if (pid == -1) { + // if the application is not started, then the first time + // we start we also display it using the default policy engine + pid = eventHandler.start(onsId, postmsg) + } else { + // we just need to display it + eventHandler.showWindow(onsId, postmsg) + } } function qmlOnReplyShowWindow(text) {