Merge lp://qastaging/~mterry/unity-mir/no-focus into lp://qastaging/unity-mir

Proposed by Michael Terry
Status: Merged
Approved by: Michael Terry
Approved revision: 226
Merged at revision: 225
Proposed branch: lp://qastaging/~mterry/unity-mir/no-focus
Merge into: lp://qastaging/unity-mir
Diff against target: 53 lines (+32/-0)
2 files modified
src/modules/Unity/Application/application_manager.cpp (+2/-0)
tests/application_manager_test.cpp (+30/-0)
To merge this branch: bzr merge lp://qastaging/~mterry/unity-mir/no-focus
Reviewer Review Type Date Requested Status
Gerry Boland (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Michał Sawicz Needs Information
Review via email: mp+220718@code.qastaging.launchpad.net

Commit message

If no app has focus when we get a un-actionable onSessionFocused event, still re-set focus to the shell.

Description of the change

If no app has focus when we get a un-actionable onSessionFocused event, still re-set focus to the shell.

During testing of split greeter, Saviq noticed that the volume up/down buttons didn't work. Some digging discovered that the android input layer thought nothing was focused and that it only happens after maliit-server is running.

Digging into unity-mir, it seems we discard onSessionFocused events that don't relate to an application (like maliit-server was generating). But apparently, android-input is a little confused at that point, and there is code in the function for re-setting the focus for the focused app.

But if no app has focus, we did nothing. In the case where no app has focus, we should also re-set the focus onto the shell. This fixed the volume bug for me.

== Checklist ==

 * Are there any related MPs required for this MP to build/function as expected? Please list.
 - No

 * Did you perform an exploratory manual test run of your code change and any related functionality?
 - Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
 - NA

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) wrote :

Could we have a test for this?

review: Needs Information
Revision history for this message
Gerry Boland (gerboland) wrote :

+1 on the test request

225. By Michael Terry

Add tests

Revision history for this message
Michael Terry (mterry) wrote :

Tests added.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Gerry Boland (gerboland) wrote :

 DLOG("Invalid application focused, discarding the event");
not correct any more, please update comment

Please add the checklist too
https://wiki.ubuntu.com/Process/Merges/Checklists/Unity-Mir

review: Needs Fixing
Revision history for this message
Gerry Boland (gerboland) wrote :

"Oo" <- as before please just make empty string

Revision history for this message
Gerry Boland (gerboland) wrote :

Testing this, everything seems ok

226. By Michael Terry

simplify test

Revision history for this message
Michael Terry (mterry) wrote :

> DLOG("Invalid application focused, discarding the event");
> not correct any more, please update comment

I disagree. It means discarding the request to focus the new app. The code that follows is just rolling back any side effects of handling the request. I only added a special case to that code anyway, rather than change its meaning.

I could change the comment to "refocusing previous focus" or something like that. But it sounds like a wordier version of the "not doing anything" meaning we already have.

> Please add the checklist too
> https://wiki.ubuntu.com/Process/Merges/Checklists/Unity-Mir

Done.

> "Oo" <- as before please just make empty string

Done.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Gerry Boland (gerboland) wrote :

> > DLOG("Invalid application focused, discarding the event");
> > not correct any more, please update comment
>
> I disagree. It means discarding the request to focus the new app.

Ok. Approved!

review: Approve
Revision history for this message
Gerry Boland (gerboland) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Y
 * Did CI run pass? If not, please explain why.
Y

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches