Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

status icon with input mode #6

Closed
fujiwarat opened this issue Mar 26, 2018 · 12 comments
Closed

status icon with input mode #6

fujiwarat opened this issue Mar 26, 2018 · 12 comments

Comments

@fujiwarat
Copy link

Forwarding from ibus/ibus#1992

Which distribution and version?:
Debian GNU/Linux 9 (stretch)

Which desktop environment and version?:
XFCE 4.12

Which session type?:
X11

IBus version?:
IBus 1.5.14

Issue description:

When I switch input mode between Chinese and English with Left Space, the icon in the tray does not change accordingly into English or Chinese, saying 五. I believe this is tiny bug for so beautiful ibus.

@fujiwarat
Copy link
Author

CC'ing @yangdaweihit

@fujiwarat
Copy link
Author

You can confirm the behavior to modify main.py

# cp /usr/share/ibus-table/engine/main.py /usr/share/ibus-table/engine/main.py.orig
# vi /usr/share/ibus-table/engine/main.py
# diff -urNp /usr/share/ibus-table/engine/main.py.orig /usr/share/ibus-table/engine/main.py
--- /usr/share/ibus-table/engine/main.py.orig	2018-03-23 15:48:17.471440383 +0900
+++ /usr/share/ibus-table/engine/main.py	2018-03-23 15:49:40.284391116 +0900
@@ -274,6 +274,9 @@ def main():
             _setup = SubElement (_engine, 'setup')
             _setup.text = setup_arg
 
+            _icon_prop_key = SubElement (_engine, 'icon_prop_key')
+            _icon_prop_key.text = 'InputMode'
+
         # now format the xmlout pretty
         indent (egs)
         egsout = tostring (egs, encoding='utf8').decode('utf-8')

# exit
% rm $HOME/.cache/ibus/bus/registry
% ibus restart

@mike-fabian
Copy link
Owner

I am not sure whether I understand that. Is the patch in the comment by Fujiwara San supposed to fix the problem?

There seems to be no icon for English mode.

wubi

@mike-fabian
Copy link
Owner

As you can see in the screenshot, the indicator at the left side of the floating panel changes from 中 to 英 when switching between Chinese and English mode. As you say, the icon in the tray is always 五 though.
But I cannot find any other ibus input method which changes the icon in the tray depending on input mode. Is this possible at all? How?

@fujiwarat
Copy link
Author

There seems to be no icon for English mode.

Hmm.., the content of your image is not expected by me.
Did you focus on a new input context after you run ibus-daemon?

My patch means to let ibus-ui-gtk3 know 'InputMode' is the property to draw the ibus panel icon.
When ibus-table switches the input modes, ibus-table calls IBus.Engine.update_property() from ibus-table/engine/table.py:_init_or_update_property_menu() and ibus-table sends 'InputMode' property.
ibus-ui-gtk3 receives properties from ibus-table and if the property is 'InputMode', ibus-ui-gtk3 checks 'InputMode.symmbol' and draws the icon as a string.

The same implementation has been done in ibus-anthy and ibus-libpinyin (and ibus-kkc?).

@fujiwarat
Copy link
Author

ibus read-cache should reflect the result to apply the 'icon_prop_key' patch.

@mike-fabian
Copy link
Owner

Oh, nice, I see that it works with ibus-anthy and ibus-libpinyin. It does not work with ibus-kkc.

@mike-fabian
Copy link
Owner

What could be the reason that it didn‘t work for me for ibus-table?
I applied the patch of course. And did "ibus read-cache" and rebooted.

@mike-fabian
Copy link
Owner

Oh, now I did
rm .cache/ibus/bus/registry

and rebooted again, this made it work. Great!!

@mike-fabian
Copy link
Owner

Sorry for forgetting this, you wrote it above.

@mike-fabian
Copy link
Owner

@fujiwarat
Copy link
Author

Thank you.

mike-fabian added a commit to mike-fabian/ibus-typing-booster that referenced this issue Dec 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants