[Library] r8478 - branches/branch-1.3/src

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[Library] r8478 - branches/branch-1.3/src fltk-dev Feb 26, 2011 top right image
 
Author: AlbrechtS
Date: 2011-02-26 06:14:50 -0800 (Sat, 26 Feb 2011)
New Revision: 8478
Log:
Suppress warnings in fl_init_xim. Only the very first warning message
will be issued (STR #2578).


Modified:
   branches/branch-1.3/src/Fl_x.cxx

Modified: branches/branch-1.3/src/Fl_x.cxx
===================================================================
--- branches/branch-1.3/src/Fl_x.cxx	2011-02-26 12:22:23 UTC (rev 8477)
+++ branches/branch-1.3/src/Fl_x.cxx	2011-02-26 14:14:50 UTC (rev 8478)
@@ -534,8 +534,10 @@
   XFree(status_attr);
 }
 
-void fl_init_xim()
-{
+void fl_init_xim() {
+  static int xim_warning = 2;
+  if (xim_warning > 0) xim_warning--;
+
   //XIMStyle *style;
   XIMStyles *xim_styles;
   if (!fl_display) return;
@@ -549,24 +551,27 @@
     XGetIMValues (fl_xim_im, XNQueryInputStyle,
                   &xim_styles, NULL, NULL);
   } else {
-    Fl::warning("XOpenIM() failed");
+    if (xim_warning)
+      Fl::warning("XOpenIM() failed");
     // if xim_styles is allocated, free it now
-    if(xim_styles) XFree(xim_styles);
+    if (xim_styles) XFree(xim_styles);
     return;
   }
 
   if (xim_styles && xim_styles->count_styles) {
     fl_new_ic();
    } else {
-     Fl::warning("No XIM style found");
+     if (xim_warning)
+       Fl::warning("No XIM style found");
      XCloseIM(fl_xim_im);
      fl_xim_im = NULL;
      // if xim_styles is allocated, free it now
-     if(xim_styles) XFree(xim_styles);
+     if (xim_styles) XFree(xim_styles);
      return;
   }
   if (!fl_xim_ic) {
-    Fl::warning("XCreateIC() failed");
+    if (xim_warning)
+      Fl::warning("XCreateIC() failed");
     XCloseIM(fl_xim_im);
     fl_xim_im = NULL;
   }

Direct Link to Message ]
 
bottom left image   bottom right image
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2022 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.