Merge lp:~gerboland/unity-mir/unfocusOnGreeter into lp:unity-mir

Proposed by Gerry Boland
Status: Needs review
Proposed branch: lp:~gerboland/unity-mir/unfocusOnGreeter
Merge into: lp:unity-mir
Diff against target: 48 lines (+11/-2)
2 files modified
src/modules/Unity/Application/application_manager.cpp (+8/-0)
tests/application_manager_test.cpp (+3/-2)
To merge this branch: bzr merge lp:~gerboland/unity-mir/unfocusOnGreeter
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
kevin gunn (community) Needs Fixing
Michael Zanetti (community) Approve
Review via email: mp+227940@code.launchpad.net

Commit message

AppMan: emit unfocus dbus event on suspend, and focus on resume

Description of the change

AppMan: emit unfocus dbus event on suspend, and focus on resume

 * Are there any related MPs required for this MP to build/function as expected? Please list.
N
 * Did you perform an exploratory manual test run of your code change and any related functionality?
Y
 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

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
Michael Zanetti (mzanetti) wrote :

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

Yip yip

 * Did CI run pass? If not, please explain why.

it did!

review: Approve
Revision history for this message
kevin gunn (kgunn72) wrote :

so, its my understanding this was proposed to fix https://bugs.launchpad.net/unity-mir/+bug/1346367
unfortunately, I tested this MP against image #148

per the bug instructions, running
gdbus call -e -d com.ubuntu.Postal -o /com/ubuntu/Postal/_ -m com.ubuntu.Postal.Post _ubuntu-system-settings '"null"'

on the device shell, would present a notification "update available" (or some such)
OK on top of dash
NOT OK on top of greeter
NOT OK with screen blanked

review: Needs Fixing
Revision history for this message
Michael Zanetti (mzanetti) wrote :

Hmm, odd. Would be interesting to know what this Postal service does. Locking the screen _does_ report "no app focused" now with the greeter locked as requested in the bug report.

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

Reading the Postal code, it actually queries GetWindowStack to check if the appId is focused or not. It's not listening for the focus change signals at all. Updating my code to match

247. By Gerry Boland

Set focusedApplication to be unfocused/focused on suspend/resume

248. By Gerry Boland

Add test

249. By Gerry Boland

Fat finger fix

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

Unmerged revisions

249. By Gerry Boland

Fat finger fix

248. By Gerry Boland

Add test

247. By Gerry Boland

Set focusedApplication to be unfocused/focused on suspend/resume

246. By Gerry Boland

AppMan: emit unfocus dbus event on suspend, and focus on resume

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/modules/Unity/Application/application_manager.cpp'
2--- src/modules/Unity/Application/application_manager.cpp 2014-07-15 11:38:42 +0000
3+++ src/modules/Unity/Application/application_manager.cpp 2014-07-25 13:46:47 +0000
4@@ -361,9 +361,17 @@
5 if (m_suspended) {
6 suspendApplication(m_mainStageApplication);
7 suspendApplication(m_sideStageApplication);
8+ if (m_focusedApplication) {
9+ m_focusedApplication->setFocused(false);
10+ m_dbusWindowStack->FocusedWindowChanged(0, QString(), 0);
11+ }
12 } else {
13 resumeApplication(m_mainStageApplication);
14 resumeApplication(m_sideStageApplication);
15+ if (m_focusedApplication) {
16+ m_focusedApplication->setFocused(true);
17+ m_dbusWindowStack->FocusedWindowChanged(0, m_focusedApplication->appId(), m_focusedApplication->stage());
18+ }
19 }
20 }
21
22
23=== modified file 'tests/application_manager_test.cpp'
24--- tests/application_manager_test.cpp 2014-07-10 11:50:00 +0000
25+++ tests/application_manager_test.cpp 2014-07-25 13:46:47 +0000
26@@ -505,7 +505,7 @@
27 EXPECT_EQ(first_session, the_app->session());
28 }
29
30-TEST_F(ApplicationManagerTests,suspended_suspends_focused_app)
31+TEST_F(ApplicationManagerTests,suspended_suspends_focused_app_and_marks_it_unfocused_in_the_model)
32 {
33 using namespace ::testing;
34 quint64 a_procId = 5921;
35@@ -534,11 +534,12 @@
36 applicationManager.setSuspended(true);
37
38 EXPECT_EQ(Application::Suspended, the_app->state());
39+ EXPECT_EQ(false, the_app->focused());
40
41 applicationManager.setSuspended(false);
42
43 EXPECT_EQ(Application::Running, the_app->state());
44-
45+ EXPECT_EQ(true, the_app->focused());
46 }
47
48 TEST_F(ApplicationManagerTests,suspend_does_not_hide)

Subscribers

People subscribed via source and target branches