From f79c27eb0f0a222fb7fc666ccd81293059e8f47e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Tue, 21 Apr 2015 21:57:00 +0200 Subject: BamfApplicationManager: use bamf_matcher_get_application_for_xid to get windows for id This reduces the DBus traffic (bzr r3899.5.2) --- unity-shared/BamfApplicationManager.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'unity-shared') 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 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 windows(bamf_view_get_children(reinterpret_cast(app)), g_list_free); for (GList* l = windows.get(); l; l = l->next) { -- cgit v1.2.3