Description of problem: It would be nice if ibus could show IME status in its panel: eg input for anthy, etc. Currently one must have the toolbar to see the input mode. uim can do this.
In quick evaluation, I think we may need C wrapper for ibus to fix this. To modify GtkStatusIcon image on gnome-panel systray, we need to access GtkImage in GtkStatusIcon. But GtkImage is a private member in GtkStatusIcon so python doesn't provide the interface of GtkImage in gtk.StatusIcon. If we try to provide a custom gtk.Image likes ibus/ui/gtk/icon.py, we need to access _gtk_tray_icon_new() but the GtkTrayIcon itself is private in gtk so python also doesn't provide the API. If we try to provide a custom _gtk_tray_icon_new(), we need to access X11 Atom but there is no x11 python. I think dbus C API is not a solution in this case since _gtk_tray_icon_new() would be need the display. How about providing a new C wrapper likes /usr/lib/python/ibus/ibusgtk.so ?
(In reply to comment #1) > In quick evaluation, I think we may need C wrapper for ibus to fix this. I noticed egg.trayicon.TrayIcon() is available in gnome-python-extra against the private GTK. It works fine for my thought. I'll finish my patch today.
Created attachment 379772 [details] Patch for ibus panel.py statusicon.py Added the trial patch. This could show the inputmode on the status icon instead of the engine icon for ja. But it seems the inputmode doesn't work with zh and ko.
I received some feedback. One is the icon background is not drawn correctly in KDE and it means the background is not updated and some garbage image is left. After I have the the furthermore investigations, I noticed I also can reproduce a similar problem in GNOME and it seems the problem cannot be fixed in the customized statusicon.py. I think the root cause is in egg.trayicon. I filed an upstream bug: https://bugzilla.gnome.org/show_bug.cgi?id=605683 If we apply my patch in the report, this problem can be fixed.
Created attachment 380831 [details] Patch for ibus panel.py statusicon.py Revised the patch. - Fixed a typo in panel.py: update_property() - Enhanced x,y coordinate - Changed the parent of statusicon.py from gtk.StatusIcon to gobject.GObject so that the width is set correctly in KDE. - Enhanced drawing input mode string. - Supported ibus-chewing, ibus-pinyin input mode and the other default input modes are taken from the engine names.
Now I could access GtkImage without using egg.trayicon.
We have embedded ime statues in the menu. I think this bug could be closed.