Fix Color Schemes menu items activation when used with libdbusmenu.

I'm not even going to try to explain why this fixes it :)
This commit is contained in:
Matthew Brush 2012-01-30 21:32:16 -08:00
parent cc3c2684fb
commit 9ff4eec853
2 changed files with 6 additions and 7 deletions

View File

@ -1172,10 +1172,6 @@ on_color_scheme_clicked(GtkMenuItem *menuitem, gpointer user_data)
gchar *fname;
gchar *path;
/* prevent callback on setting initial value */
if (!GTK_WIDGET_MAPPED(menuitem))
return;
/* check if default item */
if (!user_data)
{
@ -1255,14 +1251,15 @@ static void add_color_scheme_item(GtkWidget *menu, const gchar *fname)
g_key_file_free(skeyfile);
}
g_signal_connect(item, "activate",
G_CALLBACK(on_color_scheme_clicked), GINT_TO_POINTER(fname != NULL));
group = gtk_radio_menu_item_get_group(GTK_RADIO_MENU_ITEM(item));
if (utils_str_equal(editor_prefs.color_scheme, fname))
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), TRUE);
gtk_widget_show(item);
gtk_container_add(GTK_CONTAINER(menu), item);
g_signal_connect(item, "activate",
G_CALLBACK(on_color_scheme_clicked), GINT_TO_POINTER(fname != NULL));
}

View File

@ -1037,7 +1037,6 @@ gint main(gint argc, gchar **argv)
sidebar_init();
load_settings(); /* load keyfile */
highlighting_init();
msgwin_init();
build_init();
ui_create_insert_menu_items();
@ -1045,6 +1044,9 @@ gint main(gint argc, gchar **argv)
keybindings_init();
notebook_init();
filetypes_init();
/* depends on filetypes_array being not NULL so must be after
* filetypes_init(). */
highlighting_init();
templates_init();
navqueue_init();
document_init_doclist();