Merge lp:~uriboni/unity-2d/spread-no-windows-when-inactive into lp:unity-2d/3.0

Proposed by Ugo Riboni
Status: Merged
Approved by: Florian Boucault
Approved revision: 536
Merged at revision: 536
Proposed branch: lp:~uriboni/unity-2d/spread-no-windows-when-inactive
Merge into: lp:unity-2d/3.0
Diff against target: 44 lines (+8/-5)
1 file modified
libunity-2d-private/Unity2d/windowslist.cpp (+8/-5)
To merge this branch: bzr merge lp:~uriboni/unity-2d/spread-no-windows-when-inactive
Reviewer Review Type Date Requested Status
Florian Boucault (community) Approve
Review via email: mp+57857@code.launchpad.net

Description of the change

[spread] While the spread is not active avoid creating WindowInfo instances for windows that are opened

To post a comment you must log in.
Revision history for this message
Ugo Riboni (uriboni) wrote :

The only way to verify that this patch works as advertised is to actually go in with a debugger and verify that the WindowsList has still zero items after a new window has been created while the spread is active.

Revision history for this message
Ugo Riboni (uriboni) wrote :

I meant, "while the spread is *not* active", at the end of the previous comment.

Revision history for this message
Florian Boucault (fboucault) wrote :

Works fine. Note 753269 is merely related to that MR, not fixed by it.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libunity-2d-private/Unity2d/windowslist.cpp'
2--- libunity-2d-private/Unity2d/windowslist.cpp 2011-04-12 16:27:37 +0000
3+++ libunity-2d-private/Unity2d/windowslist.cpp 2011-04-15 11:56:41 +0000
4@@ -35,10 +35,6 @@
5 roles[WindowInfo::RoleDesktopFile] = "desktopFile";
6 roles[WindowInfo::RoleWorkspace] = "workspace";
7 setRoleNames(roles);
8-
9- BamfMatcher &matcher = BamfMatcher::get_default();
10- connect(&matcher, SIGNAL(ViewOpened(BamfView*)), SLOT(addWindow(BamfView*)));
11- connect(&matcher, SIGNAL(ViewClosed(BamfView*)), SLOT(removeWindow(BamfView*)));
12 }
13
14 WindowsList::~WindowsList()
15@@ -74,6 +70,10 @@
16
17 void WindowsList::load()
18 {
19+ BamfMatcher &matcher = BamfMatcher::get_default();
20+ connect(&matcher, SIGNAL(ViewOpened(BamfView*)), SLOT(addWindow(BamfView*)));
21+ connect(&matcher, SIGNAL(ViewClosed(BamfView*)), SLOT(removeWindow(BamfView*)));
22+
23 if (m_windows.count() > 0) {
24 beginRemoveRows(QModelIndex(), 0, m_windows.count() - 1);
25 qDeleteAll(m_windows);
26@@ -81,7 +81,6 @@
27 endRemoveRows();
28 }
29
30- BamfMatcher &matcher = BamfMatcher::get_default();
31 QList<BamfApplication*> applications;
32
33 /* List the windows of all the applications */
34@@ -122,6 +121,10 @@
35
36 void WindowsList::unload()
37 {
38+ BamfMatcher &matcher = BamfMatcher::get_default();
39+ matcher.disconnect(this, SLOT(addWindow(BamfView*)));
40+ matcher.disconnect(this, SLOT(removeWindow(BamfView*)));
41+
42 beginRemoveRows(QModelIndex(), 0, m_windows.count() - 1);
43 qDeleteAll(m_windows);
44 m_windows.clear();

Subscribers

People subscribed via source and target branches

to all changes: