fix(platform): add XIM fallback with @im=none on Linux (#1806)

Bug Fixes:
- Improved input-method initialization on X11 by retrying with a fallback backend when the initial connection fails.
- Preserved clear error handling if both connection attempts are unsuccessful.
This commit is contained in:
João Pedro M. C. Hluchan 2026-08-14 20:11:07 -03:00 committed by GitHub
parent 8f55d88980
commit 3a049b36b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -539,6 +539,11 @@ bool X11Window::internalSetupWindowInput()
XSetLocaleModifiers("");
m_xim = XOpenIM(m_display, nullptr, nullptr, nullptr);
if (!m_xim) {
// Fallback to internal XIM if ibus/fcitx daemon is unavailable or incompatible
XSetLocaleModifiers("@im=none");
m_xim = XOpenIM(m_display, nullptr, nullptr, nullptr);
}
if (!m_xim) {
g_logger.error("XOpenIM failed");
return false;