From 2521c8a51902d00364875917ee1c1bc99481d68d Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Fri, 6 Feb 2026 07:30:39 +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 fce02de32..30e006f48 100644 --- a/src/Fl_x.cxx +++ b/src/Fl_x.cxx @@ -393,7 +393,7 @@ void Fl_X11_Screen_Driver::new_ic() } } } - XFree(xim_styles); + if (xim_styles) XFree(xim_styles); if (sarea) { xim_ic = XCreateIC(xim_im, @@ -526,7 +526,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(); } }