Merge lp:~timo-jyrinki/unity/cherrypick2775 into lp:unity/6.0

Proposed by Timo Jyrinki on 2012-10-02
Status: Merged
Approved by: Michal Hruby on 2012-10-02
Approved revision: 2751
Merged at revision: 2752
Proposed branch: lp:~timo-jyrinki/unity/cherrypick2775
Merge into: lp:unity/6.0
Diff against target: 65 lines (+26/-1)
1 file modified
services/panel-indicator-entry-accessible.c (+26/-1)
To merge this branch: bzr merge lp:~timo-jyrinki/unity/cherrypick2775
Reviewer Review Type Date Requested Status
Michal Hruby (community) 2012-10-02 Approve on 2012-10-02
Review via email: mp+127453@code.launchpad.net

Commit message

Reference the menu in the accessible object. (LP: #913324)

Description of the change

Cherry-pick branch lp:~ted/unity/menu-ref ie lp:unity 2775

To post a comment you must log in.
Michal Hruby (mhr3) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'services/panel-indicator-entry-accessible.c'
2--- services/panel-indicator-entry-accessible.c 2012-03-20 16:59:23 +0000
3+++ services/panel-indicator-entry-accessible.c 2012-10-02 10:36:23 +0000
4@@ -30,6 +30,7 @@
5 struct _PanelIndicatorEntryAccessiblePrivate
6 {
7 IndicatorObjectEntry *entry;
8+ GtkMenu * menu;
9 PanelService *service;
10 gint x;
11 gint y;
12@@ -111,6 +112,25 @@
13 }
14
15 static void
16+panel_indicator_entry_accessible_dispose (GObject *object)
17+{
18+ PanelIndicatorEntryAccessible *piea;
19+
20+ g_return_if_fail (PANEL_IS_INDICATOR_ENTRY_ACCESSIBLE (object));
21+
22+ piea = PANEL_INDICATOR_ENTRY_ACCESSIBLE (object);
23+
24+ if (piea->priv != NULL)
25+ {
26+ piea->priv->entry = NULL;
27+ g_clear_object(&piea->priv->menu);
28+ }
29+
30+ G_OBJECT_CLASS (panel_indicator_entry_accessible_parent_class)->dispose (object);
31+ return;
32+}
33+
34+static void
35 panel_indicator_entry_accessible_finalize (GObject *object)
36 {
37 PanelIndicatorEntryAccessible *piea;
38@@ -136,6 +156,7 @@
39
40 /* GObject */
41 object_class = G_OBJECT_CLASS (klass);
42+ object_class->dispose = panel_indicator_entry_accessible_dispose;
43 object_class->finalize = panel_indicator_entry_accessible_finalize;
44
45 /* AtkObject */
46@@ -225,6 +246,10 @@
47
48 piea = PANEL_INDICATOR_ENTRY_ACCESSIBLE (accessible);
49 piea->priv->entry = (IndicatorObjectEntry *) data;
50+ if (piea->priv->entry->menu != NULL)
51+ {
52+ piea->priv->menu = g_object_ref(piea->priv->entry->menu);
53+ }
54
55 if (GTK_IS_LABEL (piea->priv->entry->label))
56 {
57@@ -253,7 +278,7 @@
58
59 piea = PANEL_INDICATOR_ENTRY_ACCESSIBLE (accessible);
60
61- if (piea->priv->entry->parent_object && GTK_IS_MENU (piea->priv->entry->menu))
62+ if (piea->priv->entry != NULL && piea->priv->entry->parent_object && piea->priv->menu != NULL && GTK_IS_MENU (piea->priv->menu))
63 n_children = 1;
64
65 return n_children;

Subscribers

People subscribed via source and target branches