on xenial help sign in
Use new ApplicationManager API
919a212Daniel d'Andrada
qml/Components/ApplicationManagerWrapper.qml+8
@@ -166,4 +166,12 @@ Item {
166 }
166 }
167 return desktopFile.substring(left+1, right);
167 return desktopFile.substring(left+1, right);
168 }
168 }
169+
170+ function setMainStageAppRect(item) {
171+ ApplicationManager.setMainStageAppRect(item);
172+ }
173+
174+ function setSideStageAppRect(item) {
175+ ApplicationManager.setSideStageAppRect(item);
176+ }
169}
177}
qml/Shell.qml+23
@@ -77,6 +77,9 @@ FocusScope {
77 // FIXME: if application focused before shell starts, shell draws on top of it only.
77 // FIXME: if application focused before shell starts, shell draws on top of it only.
78 // We should detect already running applications on shell start and bring them to the front.
78 // We should detect already running applications on shell start and bring them to the front.
79 applicationManager.unfocusCurrentApplication();
79 applicationManager.unfocusCurrentApplication();
80+
81+ applicationManager.setMainStageAppRect(mainStageAppRect);
82+ applicationManager.setSideStageAppRect(sideStageAppRect);
80 }
83 }
81
84
82 readonly property bool applicationFocused: !!applicationManager.mainStageFocusedApplication
85 readonly property bool applicationFocused: !!applicationManager.mainStageFocusedApplication
@@ -378,6 +381,26 @@ FocusScope {
378 orientation: Qt.Horizontal
381 orientation: Qt.Horizontal
379 }
382 }
380
383
384+ // Defines the rectangle occupied by an application on the main or side stage.
385+ // Used only to inform the ApplicationManager. Can be removed when the proper
386+ // architecture is in place (unity8 as mir compositor).
387+ Item {
388+ id: mainStageAppRect
389+ x: mainStage.x
390+ y: mainStage.y + mainStage.normalApplicationY
391+ width: mainStage.width
392+ height: mainStage.height
393+ visible: false; enabled: false
394+ }
395+ Item {
396+ id: sideStageAppRect
397+ x: sideStageRevealer.openedValue
398+ y: sideStage.y + sideStage.normalApplicationY
399+ width: sideStage.width
400+ height: sideStage.height
401+ visible: false; enabled: false
402+ }
403+
381 DragHandle {
404 DragHandle {
382 id: stagesDragHandle
405 id: stagesDragHandle
383
406