scim (1.4.9-6) 11_scim-1.4.5-panel-menu-fixes.patch

Summary

 extras/panel/scim_panel_gtk.cpp |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

    
download this patch

Patch contents

Description: fix latest factory menu labelling
Status: committed upstream in r264, can be dropped past 1.4.9
Author: Jens Petersen <petersen@redhat.com>
Source: FC14, Tue Nov  7 2006, 1.4.5-1
--- a/extras/panel/scim_panel_gtk.cpp
+++ b/extras/panel/scim_panel_gtk.cpp
@@ -742,7 +742,6 @@
         GtkWidget *lookup_table_parent;
         GtkWidget *image;
         GtkWidget *separator;
-        GtkRequisition size;
 
         if (_lookup_table_embedded) {
             _lookup_table_window = gtk_vbox_new (FALSE, 0);
@@ -1590,12 +1589,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 = "";
@@ -2721,7 +2720,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 ();
 
@@ -2733,6 +2732,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 (),
@@ -2767,16 +2767,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;
                     }
                 }
             }
@@ -2799,7 +2799,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) {