summaryrefslogtreecommitdiff
path: root/services
diff options
authorMichael Terry <michael.terry@canonical.com>2011-12-05 08:54:28 -0500
committerTarmac <>2011-12-05 08:54:28 -0500
commit634ec69161a6d2c225816d65ca5d52631da3c726 (patch)
treee6e9b55b1847861584584c4282d494d11190f591 /services
parent67404b207ad9a2248a83f6fdc50c0c3b0a8d5468 (diff)
parentde912f68b6080376e163c4f246974dac1712e68a (diff)
In https://code.launchpad.net/~mterry/unity/never-stop-oh-never-stop-the-scrubbing/+merge/47581 I added this line:
g_signal_connect (priv->last_menu, "deactivate", G_CALLBACK (gtk_widget_destroy), NULL); But destroying the widget causes dispose to be run, and GtkMenuShell's dispose causes "deactivate" to run. I'm pretty sure I tested this code and didn't get this behavior. So either this sequence changed or I'm misremembering. Regardless, it's like that now. One fix is simply to disconnect the signal handler when we get that signal, done in this branch. I'm not sure how to reproduce though. The related bug does not give useful information to get to this state. And the steps from my original merge don't work anymore, since indicator-appmenu is better these days. :-/ But the branch seems obviously correct to me.. Fixes: https://bugs.launchpad.net/bugs/851954. Reviewed by Michal Hruby. (bzr r1749)
Diffstat (limited to 'services')
-rw-r--r--services/panel-service.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/services/panel-service.c b/services/panel-service.c
index a4e7e4605..083d4d137 100644
--- a/services/panel-service.c
+++ b/services/panel-service.c
@@ -1366,6 +1366,13 @@ on_active_menu_move_current (GtkMenu *menu,
activate_next_prev_menu (self, object, priv->last_entry, direction);
}
+static void
+menu_deactivated (GtkWidget *menu)
+{
+ g_signal_handlers_disconnect_by_func (menu, menu_deactivated, NULL);
+ gtk_widget_destroy (menu);
+}
+
void
panel_service_show_entry (PanelService *self,
const gchar *entry_id,
@@ -1418,7 +1425,7 @@ panel_service_show_entry (PanelService *self,
stub menu for the duration of this scrub. */
priv->last_menu = GTK_MENU (gtk_menu_new ());
g_signal_connect (priv->last_menu, "deactivate",
- G_CALLBACK (gtk_widget_destroy), NULL);
+ G_CALLBACK (menu_deactivated), NULL);
g_signal_connect (priv->last_menu, "destroy",
G_CALLBACK (gtk_widget_destroyed), &priv->last_menu);
}