Commit eb4ba53b authored by Vincent Untz's avatar Vincent Untz Committed by Vincent Untz
Browse files

disconnect the "deactivate" signal handler (panel_menu_get): simplify

2007-06-29  Vincent Untz  <vuntz@gnome.org>

	* panel.[ch]: (panel_destroy): disconnect the "deactivate" signal
	handler
	(panel_menu_get): simplify
	(make_popup_panel_menu): make static
	Should fix bug #448025, where the panel was crashing because the
	toplevel is used while already destroyed

svn path=/trunk/; revision=10502
parent f185c6b4
2007-06-29 Vincent Untz <vuntz@gnome.org>
* panel.[ch]: (panel_destroy): disconnect the "deactivate" signal
handler
(panel_menu_get): simplify
(make_popup_panel_menu): make static
Should fix bug #448025, where the panel was crashing because the
toplevel is used while already destroyed
2007-06-29 Vincent Untz <vuntz@gnome.org>
 
Add fields to PanelToplevel to have the possibility to use a position
......
......@@ -270,8 +270,12 @@ panel_destroy (PanelToplevel *toplevel,
panel_lockdown_notify_remove (G_CALLBACK (panel_recreate_context_menu),
pd);
if (pd->menu)
if (pd->menu) {
g_signal_handlers_disconnect_by_func (pd->menu,
context_menu_deactivate,
pd);
g_object_unref (pd->menu);
}
pd->menu = NULL;
pd->panel = NULL;
......@@ -302,21 +306,18 @@ static GtkWidget *
panel_menu_get (PanelWidget *panel, PanelData *pd)
{
if (!pd->menu) {
pd->menu = g_object_ref (panel_context_menu_create (panel));
if (pd->menu) {
gtk_object_sink (GTK_OBJECT (pd->menu));
g_signal_connect (pd->menu, "deactivate",
G_CALLBACK (context_menu_deactivate),
pd);
g_signal_connect (pd->menu, "show",
G_CALLBACK (context_menu_show), pd);
}
pd->menu = g_object_ref_sink (panel_context_menu_create (panel));
g_signal_connect (pd->menu, "deactivate",
G_CALLBACK (context_menu_deactivate),
pd);
g_signal_connect (pd->menu, "show",
G_CALLBACK (context_menu_show), pd);
}
return pd->menu;
}
GtkWidget *
static GtkWidget *
make_popup_panel_menu (PanelWidget *panel_widget)
{
PanelData *pd;
......
......@@ -22,8 +22,6 @@ void back_change(AppletInfo *info, PanelWidget *panel);
PanelData *panel_setup (PanelToplevel *toplevel);
GtkWidget *make_popup_panel_menu (PanelWidget *panel);
GdkScreen *panel_screen_from_panel_widget (PanelWidget *panel);
gboolean panel_is_applet_right_stick (GtkWidget *applet);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment