summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-11-23 09:10:22 +0100
committerinfirit <[email protected]>2014-11-23 09:31:09 +0100
commitd87ffd3403e55087ee99a2c237d909503494dd6c (patch)
tree2e0119a10e88f20cbcb120659a649b466d105e8f
parent8bd5b1281af366d9039dcbc1751e676b09f97d6f (diff)
downloadmate-panel-d87ffd3403e55087ee99a2c237d909503494dd6c.tar.bz2
mate-panel-d87ffd3403e55087ee99a2c237d909503494dd6c.tar.xz
applet: Disconnect show and deactivate menu signals before destroying the applet menu
Fixes crash while removing the menu bar or a drawer. Based on gnome-panel commit: 8211f19c2c331b1502694a03e1b5abfdc793b56b From: Carlos Garcia Campos <[email protected]>
-rw-r--r--mate-panel/applet.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/mate-panel/applet.c b/mate-panel/applet.c
index fa668e89..201459e7 100644
--- a/mate-panel/applet.c
+++ b/mate-panel/applet.c
@@ -41,6 +41,8 @@ static GSList *registered_applets = NULL;
static GSList *queued_position_saves = NULL;
static guint queued_position_source = 0;
+static void applet_menu_show (GtkWidget *w, AppletInfo *info);
+static void applet_menu_deactivate (GtkWidget *w, AppletInfo *info);
static inline PanelWidget *
mate_panel_applet_get_panel_widget (AppletInfo *info)
@@ -166,6 +168,9 @@ mate_panel_applet_recreate_menu (AppletInfo *info)
menu->submenu =NULL;
}
+ g_signal_handlers_disconnect_by_func (info->menu, G_CALLBACK (applet_menu_show), info);
+ g_signal_handlers_disconnect_by_func (info->menu, G_CALLBACK (applet_menu_deactivate), info);
+
g_object_unref (info->menu);
info->menu = mate_panel_applet_create_menu (info);
}
@@ -784,8 +789,11 @@ mate_panel_applet_destroy (GtkWidget *widget,
panel_lockdown_notify_remove (G_CALLBACK (mate_panel_applet_recreate_menu),
info);
- if (info->menu)
+ if (info->menu) {
+ g_signal_handlers_disconnect_by_func (info->menu, G_CALLBACK (applet_menu_show), info);
+ g_signal_handlers_disconnect_by_func (info->menu, G_CALLBACK (applet_menu_deactivate), info);
g_object_unref (info->menu);
+ }
info->menu = NULL;
if (info->data_destroy)