Bug 174143 - pre-edit buffer not emptied after IME deactivated
pre-edit buffer not emptied after IME deactivated
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: scim (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jens Petersen
: FutureFeature, i18n
Depends On:
Blocks: FC5Target SCIM
  Show dependency treegraph
 
Reported: 2005-11-24 23:01 EST by Lawrence Lim
Modified: 2014-03-25 20:52 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-03-17 04:18:52 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Lawrence Lim 2005-11-24 23:01:33 EST
Description of problem:
Currently, if the IME is deactivated while pre-edit buffer |= NULL, when the IME
gets activated again, what was in the pre-edit buffer before will show up.

Version-Release number of selected component (if applicable):
scim-1.4.2-6

How reproducible:
Always

Steps to Reproduce:
1.in ja locale start gedit application (not locale specific)
2.activate scim
3.enter 'aka'
4.deactivate by ctrl-SPACE
5.activate scim again
  
Actual results:
Pre-edit buffer not empty

Expected results:
Pre-edit buffer should be emptied

Additional info:
Tried with CJK IME with similar behaviour.
Comment 1 Qian Shen 2005-12-05 21:06:52 EST
I have talked with Su Zhe about this bug. He said this trigger hot key should be
handled in IMEs. I think it means each IME should be update except it has
handled this hot key. 

I wrote a test patch, just make IC reset when the IME is deactived. It seems
work well. But Su Zhe think it's not a good way, because reset() has special usage.

Below is my patch for reference :

--- gtkimcontextscim.cpp.orig   2005-12-06 10:11:27.732624776 +0800
+++ gtkimcontextscim.cpp        2005-12-02 15:36:36.000000000 +0800
@@ -1256,8 +1256,10 @@
     if (hotkey_action == SCIM_FRONTEND_HOTKEY_TRIGGER) {
         if (!ic->impl->is_on)
             turn_on_ic (ic);
-        else
+        else {
             turn_off_ic (ic);
+            ic->impl->si->reset(); //qshen
+        }
         ret = true;
     } else if (hotkey_action == SCIM_FRONTEND_HOTKEY_ON) {
         if (!ic->impl->is_on)
Comment 2 Qian Shen 2005-12-05 21:30:25 EST
I think it's better to handle this deactivate/activate hot key in frontend/gtkim
moudle, because it's a global setting for frontend. We can set it in SCIM setup
window | frontend | global setting. The common setting for this hot key is
"Control+space".

SCIM gtkim moudle names this hotkey as SCIM_CONFIG_HOTKEYS_FRONTEND_TRIGGER, and
handles it in filter_hotkeys() . The X11 frontend has similar handling code for
this hotkey.

We konw that preedit string is managed by IC. Gtk-im transfer IC to SCIM, SCIM
transfer IC to IME instance. IME can be accessed through IME APIs, but the only
API to handle preedit string is reset() .

So there are 2 choices to handle this bug. One is using reset() in
frontend/gtkim module, Another is handling the hotkey in IME inside. 


 
Comment 3 Qian Shen 2006-01-03 21:29:40 EST
I had a talk with James Su. He said the hotkey should be handled in IMEs. He
didn't accepted editing the front end module. 
Comment 4 James Su 2006-01-10 23:08:43 EST
This behaviour should be implemented in each IMEngine.
When scim is deactivated, the focus_out () method will be invoked, then IMEngine
may do anything in this method, for example clearing the preedit string.
Comment 5 Jens Petersen 2006-01-11 02:24:31 EST
Thanks for the comment James.  Are there any IMEs for which resetting
pre-edit is not desirable?
Comment 6 James Su 2006-01-11 03:04:11 EST
AFAIK, some input methods provided by upcoming scim-m17n with m17n 1.3.x have
such behaviour.
Comment 8 Jens Petersen 2007-03-05 18:58:36 EST
Patch has been reverted in Fedora devel since December.

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