From ab5b28acf2a9f6019935d984876ee3b0e18c9497 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Sat, 7 Feb 2026 14:44:10 +0100 Subject: [PATCH] X11 platform: Fl::enable_im() crashes without input methods (#1364) --- src/Fl_x.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx index 99bc52a64..a2d40e2ff 100644 --- a/src/Fl_x.cxx +++ b/src/Fl_x.cxx @@ -388,7 +388,7 @@ void Fl_X11_Screen_Driver::new_ic() } } } - XFree(xim_styles); + if (xim_styles) XFree(xim_styles); if (sarea) { xim_ic = XCreateIC(xim_im, @@ -521,7 +521,7 @@ void Fl_X11_Screen_Driver::enable_im() { if (win && win->shown()) { xim_activate(fl_xid(win)); XSetICFocus(xim_ic); - } else { + } else if (xim_im) { new_ic(); } }