mirror of
https://github.com/fltk/fltk.git
synced 2026-05-28 19:35:32 +08:00
Suppress warnings in fl_init_xim. Only the very first warning message
will be issued (STR #2578). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8478 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
+12
-7
@@ -534,8 +534,10 @@ void fl_set_status(int x, int y, int w, int h)
|
|||||||
XFree(status_attr);
|
XFree(status_attr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void fl_init_xim()
|
void fl_init_xim() {
|
||||||
{
|
static int xim_warning = 2;
|
||||||
|
if (xim_warning > 0) xim_warning--;
|
||||||
|
|
||||||
//XIMStyle *style;
|
//XIMStyle *style;
|
||||||
XIMStyles *xim_styles;
|
XIMStyles *xim_styles;
|
||||||
if (!fl_display) return;
|
if (!fl_display) return;
|
||||||
@@ -549,24 +551,27 @@ void fl_init_xim()
|
|||||||
XGetIMValues (fl_xim_im, XNQueryInputStyle,
|
XGetIMValues (fl_xim_im, XNQueryInputStyle,
|
||||||
&xim_styles, NULL, NULL);
|
&xim_styles, NULL, NULL);
|
||||||
} else {
|
} else {
|
||||||
Fl::warning("XOpenIM() failed");
|
if (xim_warning)
|
||||||
|
Fl::warning("XOpenIM() failed");
|
||||||
// if xim_styles is allocated, free it now
|
// if xim_styles is allocated, free it now
|
||||||
if(xim_styles) XFree(xim_styles);
|
if (xim_styles) XFree(xim_styles);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xim_styles && xim_styles->count_styles) {
|
if (xim_styles && xim_styles->count_styles) {
|
||||||
fl_new_ic();
|
fl_new_ic();
|
||||||
} else {
|
} else {
|
||||||
Fl::warning("No XIM style found");
|
if (xim_warning)
|
||||||
|
Fl::warning("No XIM style found");
|
||||||
XCloseIM(fl_xim_im);
|
XCloseIM(fl_xim_im);
|
||||||
fl_xim_im = NULL;
|
fl_xim_im = NULL;
|
||||||
// if xim_styles is allocated, free it now
|
// if xim_styles is allocated, free it now
|
||||||
if(xim_styles) XFree(xim_styles);
|
if (xim_styles) XFree(xim_styles);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!fl_xim_ic) {
|
if (!fl_xim_ic) {
|
||||||
Fl::warning("XCreateIC() failed");
|
if (xim_warning)
|
||||||
|
Fl::warning("XCreateIC() failed");
|
||||||
XCloseIM(fl_xim_im);
|
XCloseIM(fl_xim_im);
|
||||||
fl_xim_im = NULL;
|
fl_xim_im = NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user