Bug 545695 - provide IME input mode status in panel
Summary: provide IME input mode status in panel
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: ibus
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: fujiwara
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-12-09 05:47 UTC by Jens Petersen
Modified: 2010-05-06 06:29 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2010-05-06 06:29:43 UTC
Type: ---
Embargoed:


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

Description Jens Petersen 2009-12-09 05:47:24 UTC
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 08:06:36 UTC
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-22 04:28:14 UTC
(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 06:44:31 UTC
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 17:48:13 UTC
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.

Comment 5 fujiwara 2009-12-29 17:56:53 UTC
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-25 04:29:27 UTC
Now I could access GtkImage without using egg.trayicon.

Comment 7 Peng Huang 2010-05-06 06:29:43 UTC
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.