Bug 119785 - all IM configuration code should be separated out of xinput
Summary: all IM configuration code should be separated out of xinput
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: xinitrc
Version: 2
Hardware: All
OS: Linux
high
medium
Target Milestone: ---
Assignee: Mike A. Harris
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 119404 IIIMF
TreeView+ depends on / blocked
 
Reported: 2004-04-02 06:20 UTC by Jens Petersen
Modified: 2007-11-30 22:10 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-06-29 18:04:32 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
current xinput.d/ patch (7.74 KB, patch)
2004-04-07 11:51 UTC, Jens Petersen
no flags Details | Diff
xinitrc with xinput.d support (1.68 KB, text/plain)
2004-04-07 11:52 UTC, Jens Petersen
no flags Details
current xinitrc xinput.d/ patch (untested) (7.35 KB, patch)
2004-04-07 12:02 UTC, Jens Petersen
no flags Details | Diff
tested and working implementation of xinput.d/ (8.00 KB, patch)
2004-04-09 15:18 UTC, Jens Petersen
no flags Details | Diff
latest working xinput file (shorter than patch) (1.76 KB, text/plain)
2004-04-09 15:19 UTC, Jens Petersen
no flags Details
newer tested xinput.sh with a few more improvements (1.53 KB, text/plain)
2004-06-22 14:22 UTC, Jens Petersen
no flags Details
patch to update xinitrc/xinput for xinput.d/ (8.85 KB, patch)
2004-06-23 06:36 UTC, Jens Petersen
no flags Details | Diff

Description Jens Petersen 2004-04-02 06:20:17 UTC
xinput currently has hard-coded configuration code for each of
the various Input Method configurations of the CJK locale.
It would make maintenance of xinput much easier if all the
configuration code was moved out into separate scripts packaged
individually with each IM client.  Then xinput could just source
the script appropriate for the locale, and it would become very simple.

Tagoh and I discussed this idea a couple of days ago on irc and
basically we came up with the idea that there should be a directory
say /etc/X11/xinit/xinput.d/ that would contain symlinks:

    xinput-hi_IN -> /usr/share/xinput.d/htt
    xinput-ja_JP -> /usr/share/xinput.d/kinput2-canna
    xinput-ko_KO -> /usr/share/xinput.d/nabi
    xinput-zh_CN -> /usr/share/xinput.d/htt
    xinput-zh_TW -> /usr/share/xinput.d/htt

which would allow multiple input methods to be installed
for the same locale and for sites to be able to change
the default IM per locale by changing the symlinks (as
Tagoh suggested using alternatives would surely be the best
way to handle this).  [By default of course all the symlinks
(installed by iiimf) would be to htt since that is our default IM
for fc2 but I put in various examples above to illustrate what is
possible.]

Users would still be able to override the system default by setting
XIM in their ".i18n" file, which would result in
/usr/share/xinput.d/$XIM being sourced instead.

All the actual files in /usr/share/xinput.d/ will be maintained
by the corresponding packages, and this will also make it much
easier to add new IMs in the future without having to edit xinput
everytime, or users having to resort to using ".i18n" for this.

I have already started a test implementation of this, which
I hope to have ready shortly: I'll add it here when I have tested
it.

Comment 1 Mike A. Harris 2004-04-02 07:30:37 UTC
I think this is a wonderful idea Jens, and I like the design
overview as well.  I would not put it in /usr/share I don't think
though.  It should probably be in /etc/X11/xinit or somewhere
else under /etc/X11 no?

I think it'd be good to get some feedback from others as well, to
hone the design and hear other ideas too, so I've added a few people
to CC for comment.

It'd be nice to have this for FC2 I think.



Comment 2 Mike A. Harris 2004-04-02 07:33:51 UTC
Just after hitting submit, I thought that it might be a good idea
to bounce this idea of fedora-devel-list to see if any volunteers
have additional modularization suggestions, etc.


Another benefit of this design, is that a bug in xinput script right
now can potentially kill all IM users.   While that's still true for
the above design, it is much less of a chance because a lot of the
code gets factored out, reducing risk.  As we know, we've both
recently broken xinitrc files in interesting ways recently, so
this would help mitigate our rampant carelessness in the future.
;o)

I know I kicked myself a few times for some of those dumb bugs
I goofed up.  ;o)

Thanks again,
TTYL


Comment 3 Jens Petersen 2004-04-06 03:37:17 UTC
Mike, yep you're right we don't need "/usr/share/xinput.d/":
"/etc/X11/xinit/xinput.d/" should have symlinks like:

/etc/X11/xinit/xinput.d/hi_IN -> /etc/alternatives/xinput-hi_IN
/etc/X11/xinit/xinput.d/ja_JP -> /etc/alternatives/xinput-ja_JP
/etc/X11/xinit/xinput.d/ko_KO -> /etc/alternatives/xinput-ko_KO
/etc/X11/xinit/xinput.d/zh_CN -> /etc/alternatives/xinput-zh_CN
/etc/X11/xinit/xinput.d/zh_TW -> /etc/alternatives/xinput-zh_TW

and then for example

/etc/alternatives/xinput-hi_IN -> /etc/X11/xinit/xinput.d/htt
/etc/alternatives/xinput-ja_JP -> /etc/X11/xinit/xinput.d/kinput2-canna
/etc/alternatives/xinput-ko_KO -> /etc/X11/xinit/xinput.d/nabi
/etc/alternatives/xinput-zh_CN -> /etc/X11/xinit/xinput.d/htt
/etc/alternatives/xinput-zh_TW -> /etc/X11/xinit/xinput.d/htt


Comment 4 Mike A. Harris 2004-04-07 02:37:45 UTC
Jens:

Ok, sounds reasonable to me.  How about posting this idea to
fedora-devel-list for community feedback?

Also, I'm not sure wether we should do this for FC2, or wait for
FC3 now, as time is tight, and there's lots of work yet to do.  What
do you think?

Thanks in advance,
TTYL

Comment 5 Jens Petersen 2004-04-07 11:46:06 UTC
You're probably right actually: I agree it is late to be doing
this now, so let's defer it to FC3.

Comment 6 Jens Petersen 2004-04-07 11:51:10 UTC
Created attachment 99182 [details]
current xinput.d/ patch

Here's my xinput.d patch in its current form for the record.

Comment 7 Jens Petersen 2004-04-07 11:52:32 UTC
Created attachment 99183 [details]
xinitrc with xinput.d support

and the xinput file itself, which is shorter than the above patch...

Comment 8 Jens Petersen 2004-04-07 12:02:04 UTC
Created attachment 99184 [details]
current xinitrc xinput.d/ patch (untested)

for the record here is my current patch for implementating xinput.d/ support.

Comment 10 Jens Petersen 2004-04-09 15:18:20 UTC
Created attachment 99273 [details]
tested and working implementation of xinput.d/

Comment 11 Jens Petersen 2004-04-09 15:19:55 UTC
Created attachment 99274 [details]
latest working xinput file (shorter than patch)

Comment 12 Jens Petersen 2004-04-13 00:03:21 UTC
Mike, since Test3 is delayed for a week,
I think it would be good to get this into FC2
after all.  What do you think?

Comment 16 Jens Petersen 2004-04-14 07:26:37 UTC
Actually I forgot to mention that xinput needs fixing anyway because of
"service <server> status" no longer working under selinux for normal
users.

Shortly after test2 I realised that the current version of xinput using
"service IIim status" was just a temporary fix to the problems in test2
because of service status with selinux not working - and it was thinking
of how to best fix that that led to the idea of input.d/ support. 
It really would be the simplest way to fix xinput now, IMHO.

Comment 19 Jens Petersen 2004-06-01 05:28:19 UTC
It occurred to me that since most non-Asian users do not need to
use any Input Methods (IMs) at all when running X, there is no need
for them all to run xinput (xinput.sh) every time they start an
X session since it is just a no-op for them.  Therefore it would
make more sense to move xinput out into a separate package that
IM packages would require.  This package could also im-switch and
a future GUI IM confiuration problem.

This would lead to less bug reports on xinitrc from people who
don't actually need xinput.sh.  And since the I18N Team can
maintain the new package, it will ease the current problem of
having to overcome the hurdle everytime of getting xinput updated
in xinitrc, and reduce the maintainence burden on the xinitrc
maintainer.

Comment 20 Jens Petersen 2004-06-22 14:22:42 UTC
Created attachment 101334 [details]
newer tested xinput.sh with a few more improvements

Mike, here is an update of xinput.sh with xinput.d/ support for FC3.

I still think separating out xinput.sh into a separate package is a good
idea though and with the latest xinitrc only sourcing xinitrc.d/*.sh have had
the
chance to test running without xinput and I haven't seen any problems yet
(when one doesn't want to use an IM).

Comment 21 Jens Petersen 2004-06-23 06:36:18 UTC
Created attachment 101352 [details]
patch to update xinitrc/xinput for xinput.d/

Above is an updated patch to add the new xinput to xinitrc.
Patch included necessary changes to spec file (including changelog)
and Makefile to rename xinput to xinput.sh.

Comment 23 Mike A. Harris 2004-06-29 18:04:32 UTC
Committed to xinitrc-4.0.1-1, built into FC3 devel.

Please test.


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