Merge lp:~aacid/unity-2d/spread_focus into lp:unity-2d

Proposed by Albert Astals Cid
Status: Merged
Approved by: Didier Roche-Tolomelli
Approved revision: 1066
Merged at revision: 1070
Proposed branch: lp:~aacid/unity-2d/spread_focus
Merge into: lp:unity-2d
Diff against target: 71 lines (+26/-1)
4 files modified
spread/Windows.qml (+1/-0)
spread/Workspace.qml (+8/-0)
spread/Workspaces.qml (+5/-1)
tests/manual-tests/window-manager.txt (+12/-0)
To merge this branch: bzr merge lp:~aacid/unity-2d/spread_focus
Reviewer Review Type Date Requested Status
Gerry Boland Pending
Review via email: mp+102250@code.launchpad.net

Commit message

[Spread] If there is only one window in the spread workspace activate it too

This might seem not needed since why activate window if it's the only one in the workspace, but we can apply filters to the spread workspaces so it might not be the only window in the real windowmanager workspace

Description of the change

If there is only one window in the spread workspace activate it too

This might seem not needed since why activate window if it's the only one in the workspace, but we can apply filters to the spread workspaces so it might not be the only window in the real windowmanager workspace
UNBLOCK

To post a comment you must log in.
Revision history for this message
Unity Merger (unity-merger) wrote :

The Jenkins job https://jenkins.qa.ubuntu.com/job/automerge-unity-2d/265/console reported an error when processing this lp:~aacid/unity-2d/spread_focus branch.
Not merging it.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'spread/Windows.qml'
2--- spread/Windows.qml 2012-03-06 10:04:20 +0000
3+++ spread/Windows.qml 2012-04-17 08:24:19 +0000
4@@ -101,6 +101,7 @@
5 delegate:
6 Item {
7 id: cell
8+ property alias windowItem: spreadWindow
9
10 ScaledItem {
11 id: scaledCell
12
13=== modified file 'spread/Workspace.qml'
14--- spread/Workspace.qml 2012-03-06 10:04:20 +0000
15+++ spread/Workspace.qml 2012-04-17 08:24:19 +0000
16@@ -163,10 +163,18 @@
17 }
18
19 function setFocusOnFirstWindow() {
20+ if (windows.currentIndex == 0) {
21+ // This way we make sure currentItem is updated
22+ windows.currentIndex = -1
23+ }
24 windows.currentIndex = 0
25 }
26
27 function setFocusOnLastWindow() {
28 windows.currentIndex = windows.count - 1
29 }
30+
31+ function currentWindow() {
32+ return windows.currentItem.windowItem
33+ }
34 }
35
36=== modified file 'spread/Workspaces.qml'
37--- spread/Workspaces.qml 2012-03-13 13:59:57 +0000
38+++ spread/Workspaces.qml 2012-04-17 08:24:19 +0000
39@@ -163,7 +163,11 @@
40 if (zoomedWorkspace == workspaceNumber) {
41 activateWorkspace(workspaceNumber)
42 } else if (zoomedWorkspace == -1) {
43- if (windowCount <= 1) {
44+ if (windowCount == 1) {
45+ zoomedWorkspace = workspaceNumber
46+ workspace.setFocusOnFirstWindow()
47+ activateWindow(workspace.currentWindow().windowInfo)
48+ } else if (windowCount < 1) {
49 activateWorkspace(workspaceNumber)
50 } else {
51 workspaces.currentIndex = index
52
53=== modified file 'tests/manual-tests/window-manager.txt'
54--- tests/manual-tests/window-manager.txt 2012-03-13 15:18:52 +0000
55+++ tests/manual-tests/window-manager.txt 2012-04-17 08:24:19 +0000
56@@ -11,3 +11,15 @@
57 -> Pressing Esc closes spreads on all monitors
58 -> Selecting a window in a spread closes the others
59 ----
60+
61+ * Open a Nautilus window in Workspace 1
62+ * Open a Firefox window in Workspace 1
63+ * Make the Firefox window be on top of the Nautilus one
64+ * Switch to Workspace 2
65+ * Open a Nautilus window in Workspace 2
66+ * Press the Nautilus tile in the launcher
67+ * Verify the spread appears with just the two Nautilus windows
68+ * Click on the first workspace in the spread chooser
69+ * Verify the current workspace is Workspace 1
70+ * Verify the Nautilus window is the one with the focus
71+----

Subscribers

People subscribed via source and target branches