Merge lp:~alexlauni/unity/xids-introspection into lp:unity

Proposed by Alex Launi on 2010-12-09
Status: Merged
Merged at revision: 690
Proposed branch: lp:~alexlauni/unity/xids-introspection
Merge into: lp:unity
Diff against target: 29 lines (+19/-0)
1 file modified
src/BamfLauncherIcon.cpp (+19/-0)
To merge this branch: bzr merge lp:~alexlauni/unity/xids-introspection
Reviewer Review Type Date Requested Status
Neil J. Patel (community) 2010-12-09 Approve on 2010-12-09
Review via email: mp+43193@code.launchpad.net

Description of the Change

adds an array of xids for the window managed by a launcher to introspection data

To post a comment you must log in.
Neil J. Patel (njpatel) wrote :

I think you need a g_list_free (according to docs). Everything else is good so approving pending that.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/BamfLauncherIcon.cpp'
2--- src/BamfLauncherIcon.cpp 2010-12-04 21:34:12 +0000
3+++ src/BamfLauncherIcon.cpp 2010-12-09 12:14:25 +0000
4@@ -83,6 +83,25 @@
5 LauncherIcon::AddProperties (builder);
6
7 g_variant_builder_add (builder, "{sv}", "desktop-file", g_variant_new_string (bamf_application_get_desktop_file (m_App)));
8+
9+ GList *children, *l;
10+ BamfView *view;
11+
12+ children = bamf_view_get_children (BAMF_VIEW (m_App));
13+ GVariant* xids[(int) g_list_length (children)];
14+
15+ int i = 0;
16+ for (l = children; l; l = l->next)
17+ {
18+ view = (BamfView *) l->data;
19+
20+ if (BAMF_IS_WINDOW (view))
21+ {
22+ xids[i++] = g_variant_new_uint32 (bamf_window_get_xid (BAMF_WINDOW (view)));
23+ }
24+ }
25+
26+ g_variant_builder_add (builder, "{sv}", "xids", g_variant_new_array (G_VARIANT_TYPE_UINT32, xids, i));
27 }
28
29 bool