After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 346780 - allow application to specify input method status
allow application to specify input method status
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Input Methods
unspecified
Other All
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2006-07-06 15:55 UTC by Yusuke TABATA
Modified: 2018-02-10 03:42 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
add gtk_im_context_set_im_mode() API (3.28 KB, patch)
2006-07-06 16:02 UTC, Yusuke TABATA
none Details | Review

Description Yusuke TABATA 2006-07-06 15:55:57 UTC
MS Internet Explorer has a feature to specify mode of input methods like
<input type="text" name="name" style="ime-mode:active"> in html.

* enable/disabled/inactive/auto is allowed for ime-mode.
* this is non standard extention, but this feature is useful.
* some spread sheet applications also have same feature.

To support this, we might add API to set string attribute to GtkIMContext.
It may be gtk_im_context_set_mode(GtkIMContext *ic, const char *mode);
Comment 1 Yusuke TABATA 2006-07-06 16:02:05 UTC
Created attachment 68479 [details] [review]
add gtk_im_context_set_im_mode() API

Attached patch adds gtk_im_context_set_im_mode() API.
This function passes a string attribute to GtkIMContext.

Discussion about specification of the string is required,
however IE compatible "active", "inactive", "auto", "disabled"
maybe good candidate for initial implementation.

Language or immodule specific attributes can be added later.
Comment 2 Ryo Dairiki 2006-07-09 13:06:45 UTC
"enable" and "disable" is easy to understand.
They enable and disable the IMContext, don't they?
However, what are "auto" and "disabled"?

And I wonder why the mode variable is string.
Why isn't it enum or static constant?
Comment 3 Matthias Clasen 2006-07-10 16:25:14 UTC
Why is it useful to let a web page control the status of the input method ?
That is clearly user territory. Ie if the user turned an input method on,
why would the web page be allowed to turn it back on ?

I don't see the value of this
Comment 4 Ryo Dairiki 2006-07-11 00:26:50 UTC
> Ie if the user turned an input method on, why would the web page be allowed to turn it back on ?

Of course, it might annoy the user in some cases, but they can add the preference to forbid this feature to each applications. So that's not the problem.


> Why is it useful to let a web page control the status of the input method ?

The users of web besed systems require that IM be turned off in the password entries and numeric entries. Of course, they can do it by their hands, but it requires another efforts. :<

Imagine you use the web based system with 100 entries with the person's names (including Japanese, Chinese, etc...) and his or her IDs (numeric values). You have to turn IM off everytime moves from name entry to ID entry. It's a nightmare, isn't it?

IE supports some kind of html tag which gives the browsers the hint of the IM status. Otherwise they uses activeX to switch the IM status. Both of them are not supported in Firefox, which make some developers avoid it but choose IE. :(

The problem is not limited on the web. In spreadsheet applications, there is some demand to disable IM in numeric fields and enable it in non numeric ones. (Some even require that IM should be controled by macros) Even in the desktop, I sometimes foget to turn IM off in the password dialog and fail to get authorized.

There is a really big demand to control IM status from applications, and it cannot be achived without this kind of API in every IM-module.
Comment 5 Nguyen Thai Ngoc Duy 2006-07-22 14:12:36 UTC
Another application that may make use of this feature is gvim. gvim in command mode just doesn't need any input method. If this feature is implemented, gvim will be able disable input methods when it enters command mode. And if gnome-terminal have some ways to allow program running inside disable/enable input methods, then maybe vim can do that too. Using vim with input methods enabled is really annoying.
Comment 6 Matthias Clasen 2006-07-22 18:37:24 UTC
Hmm, assuming there is a need to disable input methods, shouldn't it be
more like 

gtk_editable_set_input_method_enabled (GtkEditable *, gboolean)

with implementations for GtkEntry and GtkTextView ?
Comment 7 Nguyen Thai Ngoc Duy 2006-07-22 18:56:34 UTC
Here is the answer for comment #2 (from [1]):
auto Default. IME is not affected. This is the same as not specifying the ime-mode attribute.
active All characters are entered through the IME. Users can still deactivate the IME.
inactive All characters are entered without IME. Users can still activate the IME.
disabled IME is completely disabled. Users cannot activate the IME if the control has focus.

So I think the API proposed by Matthias is enough.
[1] http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/imemode.asp
Comment 8 Matthias Clasen 2007-07-04 06:30:38 UTC
Not going to make 2.12
Comment 9 Ming Hua 2007-07-12 20:42:03 UTC
(In reply to comment #5)
> Another application that may make use of this feature is gvim. gvim in command
> mode just doesn't need any input method. If this feature is implemented, gvim
> will be able disable input methods when it enters command mode.

I just want to point out that gvim can already be set to automatically turn off input method in normal mode, by using the "imactivatekey" option.  See the "Fully Controlled XIM" section in ":help multibyte-input".  It probably works for non-GTK+ vim in an X terminal as well.
Comment 10 Matthias Clasen 2018-02-10 03:42:47 UTC
We're moving to gitlab! As part of this move, we are closing bugs that haven't seen activity in more than 5 years. If this issue is still imporant to you and
still relevant with GTK+ 3.22 or master, please consider creating a gitlab issue
for it.