Merge lp:~ted/indicator-appmenu/lp734880 into lp:indicator-appmenu/0.3

Proposed by Ted Gould
Status: Merged
Merged at revision: 110
Proposed branch: lp:~ted/indicator-appmenu/lp734880
Merge into: lp:indicator-appmenu/0.3
Diff against target: 47 lines (+34/-3)
1 file modified
src/indicator-appmenu.c (+34/-3)
To merge this branch: bzr merge lp:~ted/indicator-appmenu/lp734880
Reviewer Review Type Date Requested Status
Conor Curran (community) Approve
Review via email: mp+53565@code.launchpad.net

Description of the change

Fleshes out the unregister function so it'll actually work :-)

To post a comment you must log in.
Revision history for this message
Conor Curran (cjcurran) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/indicator-appmenu.c'
--- src/indicator-appmenu.c 2011-03-09 14:14:39 +0000
+++ src/indicator-appmenu.c 2011-03-16 04:10:25 +0000
@@ -1305,9 +1305,40 @@
1305static GVariant *1305static GVariant *
1306unregister_window (IndicatorAppmenu * iapp, guint windowid)1306unregister_window (IndicatorAppmenu * iapp, guint windowid)
1307{1307{
1308 /* TODO: Do it */1308 g_debug("Unregistering: %d", windowid);
13091309 g_return_val_if_fail(IS_INDICATOR_APPMENU(iapp), NULL);
1310 return g_variant_new("()");1310 g_return_val_if_fail(iapp->matcher != NULL, NULL);
1311
1312 /* Get the application that uses that XID */
1313 BamfApplication * app = bamf_matcher_get_application_for_xid(iapp->matcher, windowid);
1314 if (app == NULL) {
1315 return NULL;
1316 }
1317 g_object_ref_sink(G_OBJECT(app));
1318
1319 /* Figure out which window is associated with it */
1320 GList * windows = bamf_application_get_windows(app);
1321 GList * lwindow;
1322 BamfWindow * window = NULL;
1323 for (lwindow = windows; lwindow != NULL; lwindow = g_list_next(lwindow)) {
1324 BamfWindow * thiswindow = BAMF_WINDOW(lwindow->data);
1325 if (bamf_window_get_xid(thiswindow) == windowid) {
1326 window = thiswindow;
1327 break;
1328 }
1329 }
1330 g_list_free(windows);
1331
1332 if (window == NULL) {
1333 g_object_unref(app);
1334 return NULL;
1335 }
1336
1337 /* Call the old_window handler for that window */
1338 old_window(iapp->matcher, BAMF_VIEW(window), iapp);
1339
1340 g_object_unref(app);
1341 return NULL;
1311}1342}
13121343
1313/* Grab the menu information for a specific window */1344/* Grab the menu information for a specific window */

Subscribers

People subscribed via source and target branches