Merge lp:~gerboland/qtmir/fix-unfocus-notification into lp:qtmir

Proposed by Gerry Boland
Status: Merged
Approved by: Daniel d'Andrada
Approved revision: 224
Merged at revision: 229
Proposed branch: lp:~gerboland/qtmir/fix-unfocus-notification
Merge into: lp:qtmir
Diff against target: 65 lines (+11/-6)
3 files modified
src/modules/Unity/Application/application_manager.cpp (+6/-2)
src/modules/Unity/Application/dbuswindowstack.h (+2/-2)
tests/modules/ApplicationManager/application_manager_test.cpp (+3/-2)
To merge this branch: bzr merge lp:~gerboland/qtmir/fix-unfocus-notification
Reviewer Review Type Date Requested Status
Daniel d'Andrada (community) Approve
Review via email: mp+228901@code.launchpad.net

Commit message

AppMan: fix dbus GetWindowStack & GetAppFromPid APIs. On suspend, mark focused application unfocused, and reverse on resume.

Approved by: Daniel d'Andrada

Description of the change

AppMan: fix dbus GetWindowStack & GetAppFromPid APIs. On suspend, mark focused application unfocused, and reverse 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
Gerry Boland (gerboland) wrote :

Note the twin MR for this patch is here:
https://code.launchpad.net/~gerboland/unity-mir/unfocusOnGreeter/+merge/227940
(last commit needed to be added to qtmir)

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

The commit message doesn't match what the diff actually does.

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

Looks good.

review: Approve
225. By Gerry Boland

Merge trunk

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-08-08 10:37:50 +0000
3+++ src/modules/Unity/Application/application_manager.cpp 2014-08-11 15:47:22 +0000
4@@ -322,13 +322,17 @@
5 if (m_suspended) {
6 suspendApplication(m_mainStageApplication);
7 suspendApplication(m_sideStageApplication);
8- if (m_focusedApplication)
9+ if (m_focusedApplication) {
10+ m_focusedApplication->setFocused(false);
11 m_dbusWindowStack->FocusedWindowChanged(0, QString(), 0);
12+ }
13 } else {
14 resumeApplication(m_mainStageApplication);
15 resumeApplication(m_sideStageApplication);
16- if (m_focusedApplication)
17+ if (m_focusedApplication) {
18+ m_focusedApplication->setFocused(true);
19 m_dbusWindowStack->FocusedWindowChanged(0, m_focusedApplication->appId(), m_focusedApplication->stage());
20+ }
21 }
22 }
23
24
25=== modified file 'src/modules/Unity/Application/dbuswindowstack.h'
26--- src/modules/Unity/Application/dbuswindowstack.h 2014-07-01 13:38:06 +0000
27+++ src/modules/Unity/Application/dbuswindowstack.h 2014-08-11 15:47:22 +0000
28@@ -54,8 +54,8 @@
29 explicit DBusWindowStack(ApplicationManager* parent);
30 ~DBusWindowStack();
31
32- Q_INVOKABLE Q_SCRIPTABLE AppIdDesktopFile GetAppIdFromPid(unsigned int pid);
33- Q_INVOKABLE Q_SCRIPTABLE QList<WindowInfo> GetWindowStack();
34+ Q_INVOKABLE Q_SCRIPTABLE qtmir::AppIdDesktopFile GetAppIdFromPid(unsigned int pid);
35+ Q_INVOKABLE Q_SCRIPTABLE QList<qtmir::WindowInfo> GetWindowStack();
36 Q_INVOKABLE Q_SCRIPTABLE QStringList GetWindowProperties(unsigned int window_id, const QString &app_id, const QStringList &names);
37
38 Q_SIGNALS:
39
40=== modified file 'tests/modules/ApplicationManager/application_manager_test.cpp'
41--- tests/modules/ApplicationManager/application_manager_test.cpp 2014-07-21 15:51:17 +0000
42+++ tests/modules/ApplicationManager/application_manager_test.cpp 2014-08-11 15:47:22 +0000
43@@ -502,7 +502,7 @@
44 EXPECT_EQ(first_session, the_app->session());
45 }
46
47-TEST_F(ApplicationManagerTests,suspended_suspends_focused_app)
48+TEST_F(ApplicationManagerTests,suspended_suspends_focused_app_and_marks_it_unfocused_in_the_model)
49 {
50 using namespace ::testing;
51 quint64 a_procId = 5921;
52@@ -532,11 +532,12 @@
53 applicationManager.setSuspended(true);
54
55 EXPECT_EQ(Application::Suspended, the_app->state());
56+ EXPECT_EQ(false, the_app->focused());
57
58 applicationManager.setSuspended(false);
59
60 EXPECT_EQ(Application::Running, the_app->state());
61-
62+ EXPECT_EQ(true, the_app->focused());
63 }
64
65 TEST_F(ApplicationManagerTests,requestFocusApplication)

Subscribers

People subscribed via source and target branches