arch: move X11 locale init into X11 backend display_open
XSupportsLocale and XSetLocaleModifiers in main.c were the last direct Xlib calls in src/main.c. Move them into x11_display_open (guarded by I18N) where they naturally belong. The Wayland backend does not need them — locale handling for native Wayland clients is just standard libc, and XWayland clients still receive locale-aware input via the wmaker-attached XWayland server's own setup. main.c is now Xlib-free.
This commit is contained in:
parent
60d71f46b4
commit
ee1e5b0f70
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue