Bug 509518

Summary: ibus-anthy should only override to jp layout for kana input
Product: [Fedora] Fedora Reporter: Jens Petersen <petersen>
Component: ibusAssignee: Peng Huang <phuang>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: i18n-bugs, petersen, phuang, tagoh, tfujiwar
Target Milestone: ---Keywords: Regression
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-15 02:18:59 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 473303    
Attachments:
Description Flags
Patch for ibus/bus/Makefile.am, ibus/bus/engineproxy.c, ibus/bus/main.c, ibus/configure.ac, ibus.spec
none
Patch for ibus.schemas.in none

Description Jens Petersen 2009-07-03 04:52:52 EDT
Description of problem:
anthy should not override kbd layout to jp (by default at least)
since it is not necessary.

I think we only need kbd layout override for Chewing, some m17n maps
and a few others maybe, not anthy currently anyway.

Version-Release number of selected component (if applicable):
ibus-1.2.0.20090617-1.fc12
ibus-anthy-1.2.0.20090617-1.fc12

Steps to Reproduce:
1. use anthy with US kbd
2. Alt-` and press Shift-2
  
Actual results:
2. "

Expected results:
2. @
Comment 1 Akira TAGOH 2009-07-03 05:00:28 EDT
Is it? isn't it necessary for kana input so far? it won't be needed after we move to the layout switch on xkb or xinput perhaps.
Comment 2 Jens Petersen 2009-07-05 20:03:40 EDT
(In reply to comment #0)
> I think we only need kbd layout override for Chewing, some m17n maps
> and a few others maybe, not anthy currently anyway.

Tagoh-san is right - it is needed for Kana input mode on non-US kbds,
but that's a corner case - so we should still default to system
layout for Anthy until we can fine-grain control to individual
IME modes.
Comment 3 fujiwara 2009-08-12 02:19:57 EDT
I cannot reproduce your problem.

I can type multi-byte @ with Shift + 2
Did you have the US layout?

# cat /etc/sysconfig/keyboard 
KEYBOARDTYPE="pc"
KEYTABLE="us"
LAYOUT="us"
MODEL="pc105+inet"
OPTIONS=""
VARIANT=""
Comment 4 fujiwara 2009-08-13 04:16:27 EDT
Hmm.., after I upgrade ibus 1.1 to 1.2, I could reproduce this bug.
So I think this is an ibus bug instead of ibus-anthy one.

I found another problem.
When I change keycode, ibus still sends the original keyval.

E.g. I change Menu to Henkan.
% xmodmap -e "keycode 135 = Henkan".
1. Type Ctrl + Space.
2. Type Menu key.

Then 'ibus/engine.py:' EngineProxy::ProcessKeyEvent() receives keyval = 0xff67.

I expected to receive 0xff23.

This is also reproduced in 1.2 but not 1.1.
Comment 5 fujiwara 2009-08-13 05:11:52 EDT
After I run ibus-setup and enable [Use system keyboard layout setting] in [Advanced] tag, I won't reproduce this bug.

Personally I feel the default enable setting might be preferred.
Transferring the decision.
Comment 6 Jens Petersen 2009-08-13 06:07:47 EDT
So you mean you feel it is notabug?
Comment 7 fujiwara 2009-08-14 04:56:20 EDT
> So you mean you feel it is notabug?

I guess it depends on whether we enable the default value or disable it.

ibus/data/ibus.schemas.in includes the following gconf value.

    <schema>
      <key>/schemas/desktop/ibus/general/use_system_keyboard_layout</key>
      <applyto>/desktop/ibus/general/use_system_keyboard_layout</applyto>
      <default>false</default>
    </schema>

Do you prefer the disabled value by default?
Does it effect when the check box button [Use system keyboard layout setting] is enabled and European people change the keyboard layout with gnome-keyboard-applet?
Comment 8 fujiwara 2009-08-18 00:13:58 EDT
Created attachment 357732 [details]
Patch for ibus/bus/Makefile.am, ibus/bus/engineproxy.c, ibus/bus/main.c, ibus/configure.ac, ibus.spec

Created the tentative patch to fix this problem.

/usr/share/ibus/component/anthy.xml has the hardcoded layout "jp".
Then if system layout is not used, "jp" is used.

I think XKB could resolve this bug.
Since gnome-keyboard-applet uses libxklavier, my suggestion is to implement libxklavier and override the hardcoded "jp".
I think it would works with GDM.
Comment 9 Peng Huang 2009-08-18 02:15:28 EDT
I think this patch will effect all engines, and it will also make ibus-daemon depend on X library. I think we should avoid using X libraries in the ibus-daemon.
Comment 10 fujiwara 2009-08-18 22:00:49 EDT
Talking off line, it seems some engines require "us" layout against the physical keyboard.
Transferring to ibus. Currently the maintainer works to be able to customize the engine layout:
/usr/share/ibus/component/anthy.xml

Probably I think it's better to enable system layout or disable one by default per engine.

I thought the system layout would meant /etc/sysconfig/keyboard but actually it indicates XKB layout likes user layout so it might be better to change the UI string likes "Use the current keyboard layout setting".
Comment 11 fujiwara 2009-09-09 03:04:52 EDT
Created attachment 360169 [details]
Patch for ibus.schemas.in

This is a workaround to change the schemas value for ja locale only if you require en layout for other engines.

If you change the default value "false" to a module specific value, it can be extracted into .po file.
Comment 12 Peng Huang 2009-09-09 03:21:29 EDT
I think it is better to use System keyboard layout setting by default. It has been fixed in upstream. I will build it for rawhide soon.
Comment 13 Peng Huang 2009-09-15 02:18:59 EDT
Fixed in ibus-1_2_0_20090915-1_fc12
Comment 14 Jens Petersen 2009-09-16 01:36:08 EDT
Thanks - looks good now. :)