diff --git a/src/backend/x11/x11_backend.c b/src/backend/x11/x11_backend.c index e729b26..1c3ba3b 100644 --- a/src/backend/x11/x11_backend.c +++ b/src/backend/x11/x11_backend.c @@ -107,6 +107,15 @@ struct WBackendScreen { static void * x11_display_open(const char *name) { + /* Locale init must happen before XOpenDisplay so the X server-side + * input handling honors LC_CTYPE. Previously called from main.c. */ +#ifdef I18N + if (!XSupportsLocale()) + wwarning(_("X server does not support locale")); + if (XSetLocaleModifiers("") == NULL) + wwarning(_("cannot set locale modifiers")); +#endif + Display *d = XOpenDisplay(name); if (!d) return NULL; diff --git a/src/main.c b/src/main.c index 2ea4634..f233e6e 100644 --- a/src/main.c +++ b/src/main.c @@ -748,14 +748,6 @@ static int real_main(int argc, char **argv) bind_textdomain_codeset(MENU_TEXTDOMAIN, "UTF-8"); #endif textdomain("WindowMaker"); - - if (!XSupportsLocale()) { - wwarning(_("X server does not support locale")); - } - - if (XSetLocaleModifiers("") == NULL) { - wwarning(_("cannot set locale modifiers")); - } #endif if (w_global.locale) {