summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2011-03-21 16:32:37 +0000
committerManolo Gouy <Manolo>2011-03-21 16:32:37 +0000
commitdfc067ecfcecb67c31935a005edc477a163b64c5 (patch)
tree88d3912767808819cc9081e684cfde36527acb7b /src
parenta36bca971a6c6d01aba0823b04eb5baede995b9b (diff)
Fix STR #2587: under Xlib, the X input method must be reset by the Fl::compose_reset() function.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8522 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_compose.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/Fl_compose.cxx b/src/Fl_compose.cxx
index 7069c1f27..1ea06bfde 100644
--- a/src/Fl_compose.cxx
+++ b/src/Fl_compose.cxx
@@ -33,6 +33,10 @@
int Fl::compose_state = 0;
#endif
+#if !defined(WIN32) && !defined(__APPLE__)
+extern XIC fl_xim_ic;
+#endif
+
/** Any text editing widget should call this for each FL_KEYBOARD event.
Use of this function is very simple.
@@ -76,6 +80,20 @@ int Fl::compose(int& del) {
return 1;
}
+/**
+ If the user moves the cursor, be sure to call Fl::compose_reset().
+ The next call to Fl::compose() will start out in an initial state. In
+ particular it will not set "del" to non-zero. This call is very fast
+ so it is ok to call it many times and in many places.
+ */
+void Fl::compose_reset()
+{
+ Fl::compose_state = 0;
+#if !defined(WIN32) && !defined(__APPLE__)
+ if (fl_xim_ic) XmbResetIC(fl_xim_ic);
+#endif
+}
+
//
// End of "$Id$"
//