[PATCH] XIM: pass XNSpotLocation info for most preedit styles

Roger So roger.so@sw-linux.com
Mon, 8 Mar 2004 17:08:21 +0800


--+g7M9IMkV8truYOl
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline

Hi all,

This small patch makes XNSpotLocation information available to XIM
servers in most preedit styles.  XNSpotLocation is the offset of the
current 'cursor' or 'insertion point' from the origin of the focus
window.  Currently this information is only given to XIM servers in the
XIMPreeditPosition style.  However, most modern XIM clients pass this
information to libX11 anyway regardness of the preedit style used;
libX11 is simply holding this information from XIM servers.

I have tested this patch with Gtk+ 2.x programs and OpenOffice.org 1.1;
in both cases, usability with XIM input methods was greatly improved as
relevant information during input is now shown somewhere near the
cursor, and not at some random location like before.

Please let me know if this patch is good or not.

Thanks

Roger
-- 
  Roger So                 Community Representative
  Sun Wah Linux Limited    Chinese Platform Developer
  Tel: +852 2250 0230      roger.so@sw-linux.com
  Fax: +852 2259 9112      http://www.sw-linux.com/

--+g7M9IMkV8truYOl
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: attachment; filename="spotlocation.diff"

--- xc/lib/X11/imRm.c.orig	2004-03-07 18:13:52.000000000 +0800
+++ xc/lib/X11/imRm.c	2004-03-07 18:15:33.000000000 +0800
@@ -1866,10 +1866,10 @@
 		0,
 		0},
     {XNSpotLocation, 0,
-		0,
+		(XIM_MODE_PRE_SET | XIM_MODE_PRE_GET),
 		(XIM_MODE_PRE_CREATE | XIM_MODE_PRE_SET | XIM_MODE_PRE_GET),
-		0,
-		0,
+		(XIM_MODE_PRE_SET | XIM_MODE_PRE_GET),
+		(XIM_MODE_PRE_SET | XIM_MODE_PRE_GET),
 		0,
 		0,
 		0,

--+g7M9IMkV8truYOl--