summaryrefslogtreecommitdiff
path: root/unity-shared
diff options
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2015-04-21 21:57:00 +0200
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2015-04-21 21:57:00 +0200
commitf79c27eb0f0a222fb7fc666ccd81293059e8f47e (patch)
tree9266ea1cd7c74b92fb4c5d1e9e2f0b608e4bbc4a /unity-shared
parentf04ca3be70d357d6a6f9c9a0d3260233158a8fd5 (diff)
BamfApplicationManager: use bamf_matcher_get_application_for_xid to get windows for id
This reduces the DBus traffic (bzr r3899.5.2)
Diffstat (limited to 'unity-shared')
-rw-r--r--unity-shared/BamfApplicationManager.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/unity-shared/BamfApplicationManager.cpp b/unity-shared/BamfApplicationManager.cpp
index 877bcc554..d96255af2 100644
--- a/unity-shared/BamfApplicationManager.cpp
+++ b/unity-shared/BamfApplicationManager.cpp
@@ -640,7 +640,13 @@ ApplicationWindowPtr Manager::GetWindowForId(Window xid) const
if (xid == 0)
return nullptr;
- std::shared_ptr<GList> windows(bamf_matcher_get_windows(matcher_), g_list_free);
+ // TODO: use bamf_matcher_get_window_for_xid
+ auto* app = bamf_matcher_get_application_for_xid(matcher_, xid);
+
+ if (!app)
+ return nullptr;
+
+ std::shared_ptr<GList> windows(bamf_view_get_children(reinterpret_cast<BamfView*>(app)), g_list_free);
for (GList* l = windows.get(); l; l = l->next)
{