Daiki Ueno 0539517
From 02022c17212357afb5cec727edd8f095aa40d98d Mon Sep 17 00:00:00 2001
Daiki Ueno afc7d4f
From: Daiki Ueno <ueno@unixuser.org>
Daiki Ueno afc7d4f
Date: Thu, 29 Sep 2011 10:17:28 +0900
Daiki Ueno 0539517
Subject: [PATCH 2/4] Hide status from the panel if status == title.
Daiki Ueno afc7d4f
Daiki Ueno afc7d4f
---
Daiki Ueno afc7d4f
 src/engine.c |    8 +++++++-
Daiki Ueno afc7d4f
 1 files changed, 7 insertions(+), 1 deletions(-)
Daiki Ueno afc7d4f
Daiki Ueno a692a4e
Index: ibus-m17n-1.3.4/src/engine.c
Daiki Ueno a692a4e
===================================================================
6518ef8
--- ibus-m17n-1.4.0.orig/src/engine.c	2018-10-23 15:32:43.000000000 +0200
6518ef8
+++ ibus-m17n-1.4.0/src/engine.c	2018-10-24 08:35:49.463479480 +0200
6518ef8
@@ -41,6 +41,7 @@
Daiki Ueno 0539517
     gint lookup_table_orientation;
Daiki Ueno c0bad35
     gboolean use_us_layout;
Daiki Ueno afc7d4f
 
Daiki Ueno afc7d4f
+    gchar *title;
Daiki Ueno afc7d4f
     MInputMethod *im;
Daiki Ueno afc7d4f
 };
Daiki Ueno afc7d4f
 
6518ef8
@@ -236,6 +237,10 @@
6518ef8
         "org.freedesktop.ibus.engine.m17n",
6518ef8
         g_strdup_printf ("/org/freedesktop/ibus/engine/m17n/%s/%s/",
6518ef8
                          lang, name));
Daiki Ueno afc7d4f
+    MPlist *l = minput_get_title_icon (msymbol (lang), msymbol (name));
Daiki Ueno afc7d4f
+    if (l && mplist_key (l) == Mtext) {
Daiki Ueno afc7d4f
+        klass->title = ibus_m17n_mtext_to_utf8 (mplist_value (l));
Daiki Ueno afc7d4f
+    }
Daiki Ueno 0539517
     g_free (lang);
Daiki Ueno 0539517
     g_free (name);
Daiki Ueno 0539517
 
6518ef8
@@ -961,8 +966,9 @@
Daiki Ueno afc7d4f
     else if (command == Minput_status_draw) {
Daiki Ueno afc7d4f
         gchar *status;
Daiki Ueno afc7d4f
         status = ibus_m17n_mtext_to_utf8 (m17n->context->status);
Daiki Ueno afc7d4f
+        IBusM17NEngineClass *klass = (IBusM17NEngineClass *) G_OBJECT_GET_CLASS (m17n);
Daiki Ueno afc7d4f
 
Daiki Ueno afc7d4f
-        if (status && strlen (status)) {
Daiki Ueno afc7d4f
+        if (status && strlen (status) && g_strcmp0 (status, klass->title)) {
Daiki Ueno afc7d4f
             IBusText *text;
Daiki Ueno afc7d4f
             text = ibus_text_new_from_string (status);
Daiki Ueno afc7d4f
             ibus_property_set_label (m17n->status_prop, text);