Merge lp:~gerboland/unity8/add-focus-requested-support into lp:unity8

Proposed by Gerry Boland
Status: Merged
Approved by: Michał Sawicz
Approved revision: 434
Merged at revision: 446
Proposed branch: lp:~gerboland/unity8/add-focus-requested-support
Merge into: lp:unity8
Diff against target: 78 lines (+20/-1)
4 files modified
Components/ApplicationManagerWrapper.qml (+13/-1)
Components/Stage.qml (+5/-0)
tests/mocks/Unity/Application/ApplicationInfo.h (+1/-0)
tests/mocks/Unity/Application/ApplicationManager.h (+1/-0)
To merge this branch: bzr merge lp:~gerboland/unity8/add-focus-requested-support
Reviewer Review Type Date Requested Status
Michał Sawicz Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+190621@code.launchpad.net

Commit message

WM: AppManager has new signal to ask shell to request focus for app - use it to properly animate and focus the app. If app wants to be side stage, but no side stage available, override the application stage.

Description of the change

WM: AppManager has new signal to ask shell to request focus for app - use it to properly animate and focus the app. If app wants to be side stage, but no side stage available, override the application stage.

Requires lp:~gerboland/unity-mir/add-focus-requested-signal to operate correctly

To post a comment you must log in.
434. By Gerry Boland

Revert comment change

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:434
http://jenkins.qa.ubuntu.com/job/unity8-ci/1365/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-saucy/4944/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-touch/2843
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-saucy/2231
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-amd64-ci/388
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1365
        deb: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1365/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/unity8-saucy-i386-ci/1364/console
    ABORTED: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-saucy/1120/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/819
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/819/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/2845
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/2845/artifact/work/output/*zip*/output.zip
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/2365
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/2405

Click here to trigger a rebuild:
http://10.97.0.26:8080/job/unity8-ci/1365/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) wrote :

Yes please :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Components/ApplicationManagerWrapper.qml'
2--- Components/ApplicationManagerWrapper.qml 2013-10-08 17:30:29 +0000
3+++ Components/ApplicationManagerWrapper.qml 2013-10-11 11:43:22 +0000
4@@ -18,7 +18,7 @@
5 import Unity.Application 0.1
6
7 Item {
8- id: applicationManager
9+ id: root
10
11 property alias mainStageApplications: mainStageModel
12 property alias sideStageApplications: sideStageModel
13@@ -30,6 +30,8 @@
14
15 property bool fake: ApplicationManager.fake ? ApplicationManager.fake : false
16
17+ signal focusRequested(string appId)
18+
19 ApplicationsModelStageFiltered {
20 id: mainStageModel
21 stage: ApplicationInfo.MainStage
22@@ -61,6 +63,16 @@
23 }
24 }
25 }
26+
27+ onFocusRequested: {
28+ // if no side stage enabled, override application's stage parameter
29+ var app = ApplicationManager.findApplication(appId);
30+ if (app && app.stage === ApplicationInfo.SideStage && !sideStageEnabled) {
31+ app.stage = ApplicationInfo.MainStage;
32+ }
33+
34+ root.focusRequested(appId);
35+ }
36 }
37
38 function activateApplication(desktopFile, argument) {
39
40=== modified file 'Components/Stage.qml'
41--- Components/Stage.qml 2013-10-02 21:59:30 +0000
42+++ Components/Stage.qml 2013-10-11 11:43:22 +0000
43@@ -84,6 +84,11 @@
44 }
45 }
46
47+ Connections {
48+ target: applicationManager
49+ onFocusRequested: activateApplication(appId)
50+ }
51+
52 /* Keep a reference to the focused application so that we can safely
53 unfocus it when the stage is not fully shown and refocus it when the stage
54 is fully shown again.
55
56=== modified file 'tests/mocks/Unity/Application/ApplicationInfo.h'
57--- tests/mocks/Unity/Application/ApplicationInfo.h 2013-09-05 12:21:35 +0000
58+++ tests/mocks/Unity/Application/ApplicationInfo.h 2013-10-11 11:43:22 +0000
59@@ -35,6 +35,7 @@
60 Q_OBJECT
61
62 Q_PROPERTY(bool fullscreen READ fullscreen WRITE setFullscreen NOTIFY fullscreenChanged)
63+ Q_PROPERTY(Stage stage READ stage WRITE setStage NOTIFY stageChanged)
64
65 // Only exists in this fake implementation
66
67
68=== modified file 'tests/mocks/Unity/Application/ApplicationManager.h'
69--- tests/mocks/Unity/Application/ApplicationManager.h 2013-09-09 11:42:11 +0000
70+++ tests/mocks/Unity/Application/ApplicationManager.h 2013-10-11 11:43:22 +0000
71@@ -99,6 +99,7 @@
72 void keyboardHeightChanged();
73 void keyboardVisibleChanged();
74 void focusRequested(FavoriteApplication favoriteApplication);
75+ void focusRequested(const QString &appId);
76
77 private:
78 void add(ApplicationInfo *application);

Subscribers

People subscribed via source and target branches