Permalink
Browse files

Fix Color Schemes menu items activation when used with libdbusmenu.

I'm not even going to try to explain why this fixes it :)
  • Loading branch information...
1 parent cc3c268 commit 9ff4eec8538549078d2011bd6be31d7c6f9b0194 @codebrainz codebrainz committed Jan 31, 2012
Showing with 6 additions and 7 deletions.
  1. +3 −6 src/highlighting.c
  2. +3 −1 src/main.c
View
@@ -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
@@ -1037,14 +1037,16 @@ gint main(gint argc, gchar **argv)
sidebar_init();
load_settings(); /* load keyfile */
- highlighting_init();
msgwin_init();
build_init();
ui_create_insert_menu_items();
ui_create_insert_date_menu_items();
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();

0 comments on commit 9ff4eec

Please sign in to comment.