diff --git a/Graphics/X11/Xim.hsc b/Graphics/X11/Xim.hsc
--- a/Graphics/X11/Xim.hsc
+++ b/Graphics/X11/Xim.hsc
@@ -19,6 +19,9 @@
 , utf8TextExtents
 , utf8TextEscapement
 
+, setICFocus
+, unsetICFocus
+
 ) where
 
 import Graphics.X11.XimTypes
@@ -169,6 +172,14 @@
         -- unsafePerformIO is safe like in utf8TextExtents.
 	 in unsafePerformIO $ withArray0 0 utf8Str $ \cstr ->
 		c_Xutf8TextEscapement pfs cstr ( fromIntegral $ length utf8Str )
+
+foreign import ccall "X11/Xlib.h XSetICFocus"	c_XSetICFocus :: Ptr XIC -> IO ()
+setICFocus :: XIC -> IO ()
+setICFocus (XIC xic) = c_XSetICFocus xic
+
+foreign import ccall "X11/Xlib.h XUnsetICFocus"	c_XUnsetICFocus :: Ptr XIC -> IO ()
+unsetICFocus :: XIC -> IO ()
+unsetICFocus (XIC xic) = c_XUnsetICFocus xic
 
 withMaybeCString :: Maybe String -> ( CString -> IO a ) -> IO a
 withMaybeCString Nothing      f = f nullPtr
diff --git a/tests/useXim.hs b/tests/useXim.hs
--- a/tests/useXim.hs
+++ b/tests/useXim.hs
@@ -101,6 +101,7 @@
 
 main :: IO ()
 main = runWithXIM $ \dpy win gc im ic delWin fs e -> do
+	setICFocus ic
 	posx	<- newIORef 5
 	posy	<- newIORef 20
 	doUntil_ $ do
diff --git a/x11-xim.cabal b/x11-xim.cabal
--- a/x11-xim.cabal
+++ b/x11-xim.cabal
@@ -2,7 +2,7 @@
 cabal-version:	>= 1.6
 
 name:		x11-xim
-version:	0.0.8
+version:	0.0.9.0
 author:		Yoshikuni Jujo
 maintainer:	Yoshikuni Jujo <PAF01143@nifty.ne.jp>
 license:	BSD3
@@ -20,7 +20,7 @@
 source-repository	this
   type:		git
   location:	git://github.com/YoshikuniJujo/x11-xim_haskell/
-  tag:		0.0.8
+  tag:		0.0.9.0
 	
 library
   exposed-modules:	Graphics.X11.Xim
