Bug 545695 - provide IME input mode status in panel
provide IME input mode status in panel
Product: Fedora
Classification: Fedora
Component: ibus (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: fujiwara
Fedora Extras Quality Assurance
: FutureFeature
Depends On:
  Show dependency treegraph
Reported: 2009-12-09 00:47 EST by Jens Petersen
Modified: 2010-05-06 02:29 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-05-06 02:29:43 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch for ibus panel.py statusicon.py (11.07 KB, patch)
2009-12-22 01:44 EST, fujiwara
no flags Details | Diff
Patch for ibus panel.py statusicon.py (13.27 KB, patch)
2009-12-29 12:56 EST, fujiwara
no flags Details | Diff

  None (edit)
Description Jens Petersen 2009-12-09 00:47:24 EST
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.
Comment 1 fujiwara 2009-12-18 03:06:36 EST
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 ?
Comment 2 fujiwara 2009-12-21 23:28:14 EST
(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.
Comment 3 fujiwara 2009-12-22 01:44:31 EST
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.
Comment 4 fujiwara 2009-12-29 12:48:13 EST
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:

If we apply my patch in the report, this problem can be fixed.
Comment 5 fujiwara 2009-12-29 12:56:53 EST
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.
Comment 6 fujiwara 2010-01-24 23:29:27 EST
Now I could access GtkImage without using egg.trayicon.
Comment 7 Peng Huang 2010-05-06 02:29:43 EDT
We have embedded ime statues in the menu. I think this bug could be closed.

Note You need to log in before you can comment on or make changes to this bug.