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 112099 - There should be a better way for third party input methods to make themselves known to gtk+
There should be a better way for third party input methods to make themselves...
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Input Methods
unspecified
Other Linux
: Normal enhancement
: Medium feature
Assigned To: Hidetoshi Tajima
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2003-05-02 17:52 UTC by Noah Levitt
Modified: 2013-08-14 00:55 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Noah Levitt 2003-05-02 17:52:29 UTC
To the best of my knowledge, for a third party input method to show up in
the Input Methods menu, it can either

 a) overwrite /etc/gtk-2.0/gtk.immodules or
 b) write its own version of gtk.immodules and ask the user to set the
    environment variable GTK_IM_MODULE_FILE

Both of these kinda suck. One possible solution would be to use a
/etc/gtk-2.0/immodules.d/ directory where third party modules could drop
their foo.immodules. 

Then GTK_IM_MODULE_FILE could be done away with and replaced with
GTK_IM_MODULE_PATH.
Comment 1 Owen Taylor 2003-05-02 18:01:42 UTC
What's wrong with writing a new copy of /etc/gtk-2.0/gtk.immodules?
It's just a "cache" of the results of querying the input methods 
in the input method directory.
Comment 2 Noah Levitt 2003-05-02 21:35:14 UTC
- you're not supposed write outside ${prefix}
- you're not supposed to write over something installed by a different
package
- I don't see a clean way to avoid overwriting information previously
written by other third party IMs
Comment 3 Owen Taylor 2003-05-02 21:59:30 UTC
/etc/gtk-2.0/gtk.immodules is *not* owned by GTK+,
any more that /usr/share/fonts/fonts.cache-1
is owned by fontconfig.

 gtk-query-immodules > /etc/gtk-2.0/gtk.immodules

Should be thought of as similar to 'fc-cache'.

If the user wants to use a custom setting of GTK_PATH
and doens't have write access to /etc/, they have
to set GGTK_RC_TOKEN_IM_MODULE_FILE=~/.gtk.immodules, but 
I dont' think that's too bad.

I suppose we could automatically use ~/.gtk.immodules
if found, though that causes some other possible problems.
(It might have out-of-date contents)

Comment 4 Colin Walters 2003-05-03 01:26:36 UTC
I agree that gtk-query-immodules plays a similar role as fc-cache. 
But probably an even better parallel is with gst-register from GStreamer.
They too used to put their cache in /etc, but since it's not
user-editable they moved it to /var.

Note also that gst-register can be run either as root or as a user. 
If it's run as root, it dumps the cache in the system location.  If
it's run as a user, it goes into ~/.gstreamer.  You can also specify
which paths to search for plugins.

This is ideal, in my opinion.

So in essence i think it would be best if gtk-query-immodules was
changed to put its information in /var, and to easily allow the user
to specify the search paths.

Just doing the former would satisfy my main complaint.
Comment 5 Matthias Clasen 2013-08-14 00:55:43 UTC
We put the cache next to the modules themeselves in /usr/lib/gtk-3.0 now