on xenial help sign in
Hide greeter on incoming call
commitca78ba978a73224699c8bbb9f8593c69faa7eee1 authorMichael Terry <michael.terry@canonical.com> dateTue 8 Oct 2013, 13:30 (13 years ago) parent52c37ad
2 files changed+6−39
Components/ApplicationManagerWrapper.qml−29 Shell.qml+6−10
Components/ApplicationManagerWrapper.qml−29
@@ -25,7 +25,6 @@ Item {
2525 property variant mainStageFocusedApplication: null
2626 property variant sideStageFocusedApplication: null
2727 property bool sideStageEnabled: true
28− signal focusRequested(string desktopFile)
2928 property bool keyboardVisible: ApplicationManager.keyboardVisible
3029 property int keyboardHeight: ApplicationManager.keyboardHeight
3130
@@ -155,32 +154,4 @@ Item {
155154 }
156155 return desktopFile.substring(left+1, right);
157156 }
158−
159− Connections {
160− target: ApplicationManager
161− onFocusRequested: {
162− // FIXME: hardcoded mapping from ApplicationManager.FavoriteApplications
163− // enum to desktop files
164− var desktopFile
165− if (favoriteApplication == ApplicationManager.CameraApplication) {
166− desktopFile = "/usr/share/applications/camera-app.desktop"
167− } else if (favoriteApplication == ApplicationManager.GalleryApplication) {
168− desktopFile = "/usr/share/applications/gallery-app.desktop"
169− } else if (favoriteApplication == ApplicationManager.ShareApplication) {
170− desktopFile = "/usr/share/applications/share-app.desktop"
171− } else if (favoriteApplication == ApplicationManager.BrowserApplication) {
172− desktopFile = "/usr/share/applications/webbrowser-app.desktop"
173− } else if (favoriteApplication == ApplicationManager.PhoneApplication) {
174− desktopFile = "/usr/share/applications/phone-app.desktop"
175− } else if (favoriteApplication == ApplicationManager.DialerApplication) {
176− desktopFile = "/usr/share/applications/dialer-app.desktop"
177− } else if (favoriteApplication == ApplicationManager.MessagingApplication) {
178− desktopFile = "/usr/share/applications/messaging-app.desktop"
179− } else if (favoriteApplication == ApplicationManager.AddressbookApplication) {
180− desktopFile = "/usr/share/applications/address-book-app.desktop"
181− }
182−
183− applicationManager.focusRequested(desktopFile);
184− }
185− }
186157}
Shell.qml+6−10
@@ -84,7 +84,6 @@ FocusScope {
8484
8585 readonly property bool applicationFocused: !!applicationManager.mainStageFocusedApplication
8686 || !!applicationManager.sideStageFocusedApplication
87− // Used for autopilot testing.
8887 readonly property string currentFocusedAppId: ApplicationManager.focusedApplicationId
8988
9089 readonly property bool fullscreenMode: {
@@ -99,15 +98,12 @@ FocusScope {
9998 }
10099 }
101100
102− Connections {
103− target: applicationManager
104− ignoreUnknownSignals: true
105− onFocusRequested: {
106− // TODO: this should be protected to only unlock for certain applications / certain usecases
107− // potentially only in connection with a notification
108− greeter.hide();
109− shell.activateApplication(desktopFile);
110− }
101+ onCurrentFocusedAppIdChanged: {
102+ // If any app is focused when greeter is open, it's due to a user action
103+ // like a snap decision (say, an incoming call).
104+ // TODO: this should be protected to only unlock for certain applications / certain usecases
105+ // potentially only in connection with a notification.
106+ greeter.hide()
111107 }
112108
113109 function activateApplication(desktopFile, argument) {