Blame SOURCES/ibus-m17n-hide-title-status.patch

8d55ff
From 02022c17212357afb5cec727edd8f095aa40d98d Mon Sep 17 00:00:00 2001
8d55ff
From: Daiki Ueno <ueno@unixuser.org>
8d55ff
Date: Thu, 29 Sep 2011 10:17:28 +0900
8d55ff
Subject: [PATCH 2/4] Hide status from the panel if status == title.
8d55ff
8d55ff
---
8d55ff
 src/engine.c |    8 +++++++-
8d55ff
 1 files changed, 7 insertions(+), 1 deletions(-)
8d55ff
8d55ff
Index: ibus-m17n-1.3.4/src/engine.c
8d55ff
===================================================================
8d55ff
--- ibus-m17n-1.3.4.orig/src/engine.c
8d55ff
+++ ibus-m17n-1.3.4/src/engine.c
8d55ff
@@ -38,6 +38,7 @@ struct _IBusM17NEngineClass {
8d55ff
     gint lookup_table_orientation;
8d55ff
     gboolean use_us_layout;
8d55ff
 
8d55ff
+    gchar *title;
8d55ff
     MInputMethod *im;
8d55ff
 };
8d55ff
 
8d55ff
@@ -233,6 +234,10 @@ ibus_m17n_engine_class_init (IBusM17NEng
8d55ff
     }
8d55ff
     engine_name = g_strdup_printf ("m17n:%s:%s", lang, name);
8d55ff
     klass->config_section = g_strdup_printf ("engine/M17N/%s/%s", lang, name);
8d55ff
+    MPlist *l = minput_get_title_icon (msymbol (lang), msymbol (name));
8d55ff
+    if (l && mplist_key (l) == Mtext) {
8d55ff
+        klass->title = ibus_m17n_mtext_to_utf8 (mplist_value (l));
8d55ff
+    }
8d55ff
     g_free (lang);
8d55ff
     g_free (name);
8d55ff
 
8d55ff
@@ -924,8 +929,9 @@ ibus_m17n_engine_callback (MInputContext
8d55ff
     else if (command == Minput_status_draw) {
8d55ff
         gchar *status;
8d55ff
         status = ibus_m17n_mtext_to_utf8 (m17n->context->status);
8d55ff
+        IBusM17NEngineClass *klass = (IBusM17NEngineClass *) G_OBJECT_GET_CLASS (m17n);
8d55ff
 
8d55ff
-        if (status && strlen (status)) {
8d55ff
+        if (status && strlen (status) && g_strcmp0 (status, klass->title)) {
8d55ff
             IBusText *text;
8d55ff
             text = ibus_text_new_from_string (status);
8d55ff
             ibus_property_set_label (m17n->status_prop, text);