Shell needs to unfocus app when greeter is shown

Bug #1183113 reported by Bill Filler
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
touch-preview-images
Fix Released
High
Michał Sawicz
unity8 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

When the greeter is shown, either from screen timeout trigger or user pressing the power button, the shell needs to unfocus the currently focused app. Otherwise, if the app has focus and the keyboard is displayed it will stay displayed when the greeter is shown on power button event.

According to ricmm, the following needs to be done:
Shell needs to call unfocusCurrentApplication() when greeter.show(), but also refocus the index of the unfocused application when greeter.hide(), because otherwise the application that comes to view will be suspended

ricmm:

This comes in addition to a QtUbuntu branch that will cause a dismissal of the QInputPanel in the delegate for transition to the SUSPENDED state, effectively dismissing the keyboard and removing input focus from any active text field.

Related branches

Bill Filler (bfiller)
Changed in touch-preview-images:
milestone: none → ubuntu-13.05
assignee: nobody → Gerry Boland (gerboland)
importance: Undecided → High
Changed in unity:
assignee: nobody → Gerry Boland (gerboland)
Ricardo Mendoza (ricmm)
description: updated
Revision history for this message
Michał Sawicz (saviq) wrote :

@ricmm I had a quick look and calling unfocusCurrentApplication() nor unfocusCurrentApplication(ApplicationInfo::MainStage) actually did unfocus the app (it was still there in ApplicationManager.mainStageFocusedApplication).

Any ideas?

Changed in unity:
status: New → Confirmed
assignee: Gerry Boland (gerboland) → Michał Sawicz (saviq)
Changed in touch-preview-images:
status: New → Confirmed
assignee: Gerry Boland (gerboland) → Michał Sawicz (saviq)
Revision history for this message
Ricardo Mendoza (ricmm) wrote :

@saviq The reason for that is that we indeed do *not* support an unfocusCurrentApplication() method on the platform API. That naming decision comes from QtUbuntu that wraps it around unfocus_running_sessions() which just brings up focus (in the sense of layer visibility and input windows) to system-sessions only.

As I said in my comment in the description, the naming of this bug might be misleading. The right way is to dismiss input contexts when an application is about to be unfocused (either by means of returning to shell, or focusing another application). This is done via a delegate call, now that the new API code has landed I will propose a branch for this today.

Revision history for this message
Michał Sawicz (saviq) wrote :

(I'm off until Monday, btw...)

Hey ricmm, so what is it that we need to do in the shell still? I have a preliminary diff that unfocuses (but not refocuses yet) the app on greeter shown:

=== modified file 'Shell.qml'
--- Shell.qml 2013-05-28 08:38:45 +0000
+++ Shell.qml 2013-05-31 08:30:45 +0000
@@ -353,7 +353,12 @@
         width: parent.width
         height: parent.height - panel.panelHeight

- onShownChanged: if (shown) greeter.forceActiveFocus()
+ onShownChanged: {
+ if (shown) {
+ greeter.forceActiveFocus()
+ applicationManager.unfocusCurrentApplication();
+ }
+ }

         onUnlocked: greeter.hide()
         onSelected: {

Gerry Boland (gerboland)
Changed in touch-preview-images:
status: Confirmed → Fix Committed
Changed in unity:
status: Confirmed → Fix Committed
Gerry Boland (gerboland)
Changed in unity:
status: Fix Committed → Confirmed
Changed in touch-preview-images:
status: Fix Committed → Confirmed
Michał Sawicz (saviq)
Changed in unity:
status: Confirmed → In Progress
Changed in touch-preview-images:
status: Confirmed → In Progress
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:unity/phablet at revision 721, scheduled for release in unity, milestone 13.05

Changed in unity:
status: In Progress → Fix Committed
Changed in touch-preview-images:
status: In Progress → Fix Released
Stephen M. Webb (bregma)
no longer affects: unity
Michał Sawicz (saviq)
no longer affects: unity/phablet
Changed in unity8:
status: New → Fix Released
Michał Sawicz (saviq)
affects: unity8 → unity8 (Ubuntu)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.