Author: manolo
Date: 2011-03-21 09:32:37 -0700 (Mon, 21 Mar 2011)
New Revision: 8522
Log:
Fix STR #2587: under Xlib, the X input method must be reset by the 
Fl::compose_reset() function.

Modified:
   branches/branch-1.3/FL/Fl.H
   branches/branch-1.3/src/Fl_compose.cxx

Modified: branches/branch-1.3/FL/Fl.H
===================================================================
--- branches/branch-1.3/FL/Fl.H 2011-03-20 21:43:10 UTC (rev 8521)
+++ branches/branch-1.3/FL/Fl.H 2011-03-21 16:32:37 UTC (rev 8522)
@@ -678,13 +678,7 @@
   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);

Modified: branches/branch-1.3/src/Fl_compose.cxx
===================================================================
--- branches/branch-1.3/src/Fl_compose.cxx      2011-03-20 21:43:10 UTC (rev 
8521)
+++ branches/branch-1.3/src/Fl_compose.cxx      2011-03-21 16:32:37 UTC (rev 
8522)
@@ -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 @@
   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$"
 //

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to