summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Fl_x.cxx19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx
index a0e64744a..282c10b60 100644
--- a/src/Fl_x.cxx
+++ b/src/Fl_x.cxx
@@ -534,8 +534,10 @@ void fl_set_status(int x, int y, int w, int h)
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 @@ void fl_init_xim()
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;
}