diff -u scim-1.4.5/extras/panel/scim_panel_gtk.cpp.11-factory-menu scim-1.4.5/extras/panel/scim_panel_gtk.cpp --- scim-1.4.5/extras/panel/scim_panel_gtk.cpp.11-factory-menu 2006-12-15 17:33:53.000000000 +1000 +++ scim-1.4.5/extras/panel/scim_panel_gtk.cpp 2006-12-15 17:33:53.000000000 +1000 @@ -720,7 +720,6 @@ GtkWidget *lookup_table_parent; GtkWidget *image; GtkWidget *separator; - GtkRequisition size; if (_lookup_table_embedded) { _lookup_table_window = gtk_vbox_new (FALSE, 0); @@ -1529,12 +1528,12 @@ GtkWidget *icon_image; String text, tooltip; - if (show_lang && !show_name) { - text = scim_get_language_name (info.lang); - tooltip = info.name; - } else if (!show_lang && show_name) { + if ((!show_lang && show_name) || (show_lang && !show_name && (info.lang == "C" || info.lang == "~other"))) { text = info.name; tooltip = ""; + } else if (show_lang && !show_name) { + text = scim_get_language_name (info.lang); + tooltip = info.name; } else { text = scim_get_language_name (info.lang) + " - " + info.name; tooltip = ""; @@ -2651,7 +2650,7 @@ size_t i; MapStringVectorSizeT groups; - std::map<String,size_t> recents; + std::map<String,size_t> langs, recents; guint32 activate_time = gtk_get_current_event_time (); @@ -2663,6 +2662,7 @@ for (i = 0; i < factories.size (); ++i) { _factory_menu_uuids.push_back (factories [i].uuid); + langs [factories [i].lang]++; if (show_recent && std::find (_recent_factory_uuids.begin (), _recent_factory_uuids.end (), @@ -2697,16 +2697,16 @@ // recently used factories if (show_recent && recents.size ()) { for (std::list<String>::iterator it = _recent_factory_uuids.begin (); it != _recent_factory_uuids.end (); ++it) { + id = recents [*it]; info = factories [id]; - ui_create_factory_menu_entry (info, id, GTK_MENU_SHELL (_factory_menu), true, true); + ui_create_factory_menu_entry (info, id, GTK_MENU_SHELL (_factory_menu), true, (langs [info.lang] > 1)); if (use_submenus) { MapStringVectorSizeT::iterator g = groups.find (info.lang); if (g != groups.end () && g->second.size () >= 1) { g->second.push_back (id); - use_submenus = true; } } } @@ -2729,7 +2729,7 @@ for (i = 0; i < it->second.size (); ++i) { id = it->second [i]; info = factories [id]; - ui_create_factory_menu_entry (info, id, GTK_MENU_SHELL (submenu ? submenu : _factory_menu), !submenu, submenu || !use_submenus); + ui_create_factory_menu_entry (info, id, GTK_MENU_SHELL (submenu ? submenu : _factory_menu), !submenu, (langs [info.lang] > 1)); } if (menu_item && submenu) {