Browse Source

Disconnect the icon theme changed signal from a launcher when it

is destroyed to avoid crash when the icon theme changes.


(Old svn revision: 29740)
upstream/xfce4-panel-4.10.1
Nick Schermer 13 years ago
parent
commit
7a0c3900d4
  1. 2
      NEWS
  2. 16
      plugins/launcher/launcher.c
  3. 3
      plugins/launcher/launcher.h

2
NEWS

@ -7,6 +7,8 @@
- Fix xfce-hvbox not working with gtk 2.16 (bug #5166).
- Don't crash the launcher plugin when the launcher entry list is empty.
- Add icon-name fallback to the show desktop plugin (bug #5117).
- Disconnect the icon theme changed signal from a launcher when it
is destroyed to avoid crash when the icon theme changes.
4.6.0

16
plugins/launcher/launcher.c

@ -1020,7 +1020,6 @@ launcher_plugin_new (XfcePanelPlugin *plugin)
{
LauncherPlugin *launcher;
GtkIconTheme *icon_theme;
GdkScreen *screen;
/* create launcher structure */
launcher = panel_slice_new0 (LauncherPlugin);
@ -1056,10 +1055,10 @@ launcher_plugin_new (XfcePanelPlugin *plugin)
gtk_button_set_focus_on_click (GTK_BUTTON (launcher->arrow_button), FALSE);
/* hook for icon themes changes */
screen = gtk_widget_get_screen (launcher->image);
icon_theme = gtk_icon_theme_get_for_screen (screen);
g_signal_connect (G_OBJECT (icon_theme), "changed",
G_CALLBACK (launcher_utility_icon_theme_changed), launcher);
icon_theme = gtk_icon_theme_get_default ();
launcher->icon_theme_change_handler =
g_signal_connect (G_OBJECT (icon_theme), "changed",
G_CALLBACK (launcher_utility_icon_theme_changed), launcher);
/* icon button signals */
g_signal_connect (G_OBJECT (launcher->icon_button), "state-changed",
@ -1474,11 +1473,18 @@ static void
launcher_plugin_free (LauncherPlugin *launcher)
{
GtkWidget *dialog;
GtkIconTheme *icon_theme;
/* check if we still need to destroy the properties dialog */
dialog = g_object_get_data (G_OBJECT (launcher->panel_plugin), I_("launcher-dialog"));
if (G_UNLIKELY (dialog != NULL))
gtk_dialog_response (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL);
/* disconnect icon theme change handler */
icon_theme = gtk_icon_theme_get_default ();
if (launcher->icon_theme_change_handler != 0)
g_signal_handler_disconnect (G_OBJECT (icon_theme),
launcher->icon_theme_change_handler);
/* stop timeout */
if (G_UNLIKELY (launcher->popup_timeout_id))

3
plugins/launcher/launcher.h

@ -92,6 +92,9 @@ struct _LauncherPlugin
/* settings */
guint move_first : 1;
guint arrow_position;
/* icon theme changed handler */
gulong icon_theme_change_handler;
};
enum

Loading…
Cancel
Save