Bug 1853 - uim-svn1643: uim-xim doesn't work
Summary: uim-svn1643: uim-xim doesn't work
Status: RESOLVED FIXED
Alias: None
Product: UIM
Classification: Unclassified
Component: bridge: XIM (show other bugs)
Version: unspecified
Hardware: All All
: high normal
Assignee: uim-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-14 19:13 UTC by UTUMI Hirosi
Modified: 2004-11-14 04:21 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description UTUMI Hirosi 2004-11-14 19:13:09 UTC
I can't type Japanese to XIM apps on uim-svn1643.
I replaced uim-svn1643 with uim-0.4.5-official, then
uim-xim works again.
Is it only me?
Comment 1 Etsushi Kato 2004-11-14 20:06:48 UTC
Check XMODIFIERS environ variable.  For preparation of 0.4.6, I deleted
old-style XMODIFIERS=@im=uim-foobar ximserver registration.  If you use this
old-style XMODIFIERS variable, please use XMODIFIERS=@im=uim instead.
Comment 2 UTUMI Hirosi 2004-11-14 20:42:52 UTC
I'm using LANG=ja_JP, XMODIFIERS=@im=uim.

uim-xim always uses "uim-direct" on startup.
I ran uim-im-sw and changed "uim-direct" to "uim-anthy",
now I can type Japanese.

uim-immodule always uses "uim-anthy" on startup in ja_JP.
I think uim-xim shouldn't use uim-direct on startup in ja_JP.
Comment 3 Etsushi Kato 2004-11-14 21:23:03 UTC
OK.  Thanks for reporting.  I can reproduce the bug.
I think this is not a bug in uim-xim.
uim-xim uses proper way to get default im using uim_get_default_im_name().

This seems like bug in scm or siod level, since getting () if I input
(uim-get-default-im-name "ja_JP")  in uim-sh.
Comment 4 Etsushi Kato 2004-11-14 21:29:41 UTC
Oops, please ignore last message about uim-sh.
Returning () is OK with uim-get-default-im-name.
Comment 5 Etsushi Kato 2004-11-14 21:39:21 UTC
OK.  Now I understand the reason of getting "direct" with uim-xim.

Recently YamaKen modified im.scm to recored latest IM to default-im-name.  This
change causes getting "direct" while using uim_get_default_im_name() after
creating uim context with NULL  uim_create_context() with NULL is invoked to get
all the im available from libuim to store uim's information into uim-xim.

I don't think it good idea to store im's info if bridge create context with NULL, 
or my usage of uim_create_context() is no longer supported?  What do you think
about this, Tokunaga-san?
Comment 6 Etsushi Kato 2004-11-14 21:55:40 UTC
The temporal fix of the bug is applying following patch.

Index: im.scm
===================================================================
--- im.scm	(revision 1644)
+++ im.scm	(working copy)
@@ -205,7 +205,8 @@
       ;; To remember the IM selected by uim-toolbar, we record the
       ;; latest IM to default-im-name. This makes subsequent contexts
       ;; the selected one. -- YamaKen 2004-11-11
-      (set! default-im-name (im-name im))
+      (if name
+          (set! default-im-name (im-name im)))
       (im-set-encoding id (im-encoding im))
       (update-style uim-color-spec (symbol-value uim-color))
       (let* ((handler (im-init-handler im))
Comment 7 YamaKen 2004-11-14 22:31:47 UTC
I suggest another workaround. It will reduce unwanted behavior for uim-xim.
Etsushi, please test it.

Index: scm/im.scm
===================================================================
--- scm/im.scm	(revision 1644)
+++ scm/im.scm	(working copy)
@@ -202,10 +202,6 @@
 	   (arg (and im (im-init-arg im))))
       (if (find-context id)
 	  (release-context id))
-      ;; To remember the IM selected by uim-toolbar, we record the
-      ;; latest IM to default-im-name. This makes subsequent contexts
-      ;; the selected one. -- YamaKen 2004-11-11
-      (set! default-im-name (im-name im))
       (im-set-encoding id (im-encoding im))
       (update-style uim-color-spec (symbol-value uim-color))
       (let* ((handler (im-init-handler im))
Index: uim/uim.c
===================================================================
--- uim/uim.c	(revision 1644)
+++ uim/uim.c	(working copy)
@@ -248,6 +248,13 @@
   uc->short_desc = uim_return_str;
   uim_return_str = NULL;  /* ownership has been transferred */
 #endif
+
+  /*
+     To remember the IM selected by uim-toolbar, we record the latest
+     IM to default-im-name. This makes subsequent contexts the
+     selected one. -- YamaKen 2004-11-11
+  */
+  UIM_EVAL_FSTRING1(uc, "(set! default-im-name '%s)", engine);
 }
 
 void
Comment 8 Etsushi Kato 2004-11-14 22:49:40 UTC
Works fine.

I also think handling this in IM-swithing is more appropriate than in context
creation.
Comment 9 YamaKen 2004-11-14 23:10:53 UTC
> I also think handling this in IM-swithing is more appropriate than in context
> creation.
Me too. Okay, I'll commit it.
Comment 10 YamaKen 2004-11-14 23:21:58 UTC
Fixed in r1645.

------------------------------------------------------------------------
r1645 | yamaken | 2004-11-15 16:20:12 +0900 (Mon, 15 Nov 2004) | 11 lines

* This commit fixes an unwanted and inappropriate behavior for uim-xim
  added in r1633, and also fixes bug #1853.

* scm/im.scm
  - (create-context): Remove default-im-name modification based on the
    passed im-name added in r1633.
* uim/uim.c
  - (uim_switch_im): Add the default-im-name modification based on the
    passed im-name moved from create-context. This is the appropriate
    responsibility separation.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.