Merge lp:~saviq/unity/phablet.greeter-unfocus into lp:unity/phablet

Proposed by Michał Sawicz
Status: Merged
Approved by: Sergio Schvezov
Approved revision: no longer in the source branch.
Merged at revision: 721
Proposed branch: lp:~saviq/unity/phablet.greeter-unfocus
Merge into: lp:unity/phablet
Diff against target: 33 lines (+22/-1)
1 file modified
Shell.qml (+22/-1)
To merge this branch: bzr merge lp:~saviq/unity/phablet.greeter-unfocus
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Sergio Schvezov Approve
Ricardo Mendoza (community) Approve
Review via email: mp+166913@code.launchpad.net

Commit message

unfocus and refocus apps on lock / unlock

Description of the change

This is to make sure that the keyboard is removed when locking.

To post a comment you must log in.
Revision history for this message
Ricardo Mendoza (ricmm) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Sergio Schvezov (sergiusens) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Shell.qml'
2--- Shell.qml 2013-05-31 17:28:33 +0000
3+++ Shell.qml 2013-05-31 22:50:32 +0000
4@@ -365,7 +365,28 @@
5 width: parent.width
6 height: parent.height - panel.panelHeight
7
8- onShownChanged: if (shown) greeter.forceActiveFocus()
9+ property var previousMainApp: null
10+ property var previousSideApp: null
11+
12+ onShownChanged: {
13+ if (shown) {
14+ greeter.forceActiveFocus();
15+ // FIXME: *FocusedApplication are not updated when unfocused, hence the need to check whether
16+ // the stage was actually shown
17+ if (mainStage.fullyShown) greeter.previousMainApp = applicationManager.mainStageFocusedApplication;
18+ if (sideStage.fullyShown) greeter.previousSideApp = applicationManager.sideStageFocusedApplication;
19+ applicationManager.unfocusCurrentApplication();
20+ } else {
21+ if (greeter.previousMainApp) {
22+ applicationManager.focusApplication(greeter.previousMainApp);
23+ greeter.previousMainApp = null;
24+ }
25+ if (greeter.previousSideApp) {
26+ applicationManager.focusApplication(greeter.previousSideApp);
27+ greeter.previousSideApp = null;
28+ }
29+ }
30+ }
31
32 onUnlocked: greeter.hide()
33 onSelected: {

Subscribers

People subscribed via source and target branches