DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2587
Version: 1.3-current


The compose voodoo is done inside Xlib, so for compose_reset() to actually
do anything meaningful we need to tell Xlib to drop state. Fortunately
this is very simple. Attached patch does just that.

Note that this patch modifies the ABI and should therefore be applied
before final release.


Link: http://www.fltk.org/str.php?L2587
Version: 1.3-current
diff -up fltk-1.3.x-r8501/FL/Fl.H.compose fltk-1.3.x-r8501/FL/Fl.H
--- fltk-1.3.x-r8501/FL/Fl.H.compose    2011-03-10 16:43:36.908728039 +0100
+++ fltk-1.3.x-r8501/FL/Fl.H    2011-03-10 16:45:48.357447792 +0100
@@ -678,13 +678,7 @@ public:
   static int event_length() {return e_length;}
 
   static int compose(int &del);
-  /**
-    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.
-  */
-  static void compose_reset() {compose_state = 0;}
+  static void compose_reset();
   static int event_inside(int,int,int,int);
   static int event_inside(const Fl_Widget*);
   static int test_shortcut(Fl_Shortcut);
diff -up fltk-1.3.x-r8501/src/Fl_compose.cxx.compose 
fltk-1.3.x-r8501/src/Fl_compose.cxx
--- fltk-1.3.x-r8501/src/Fl_compose.cxx.compose 2011-03-10 16:43:48.110556346 
+0100
+++ fltk-1.3.x-r8501/src/Fl_compose.cxx 2011-03-10 16:55:22.401898007 +0100
@@ -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,22 @@ 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)
+    Xutf8ResetIC(fl_xim_ic);
+#endif
+}
+
 //
 // End of "$Id: Fl_compose.cxx 8173 2011-01-03 16:50:34Z manolo $"
 //
_______________________________________________
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs

Reply via email to