Move X locale support to "src/dwm.c"

This commit is contained in:
Alex Kotov 2021-11-21 10:27:41 +05:00
parent 01610d88d7
commit 324d6c374b
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08
3 changed files with 5 additions and 9 deletions

View file

@ -279,6 +279,10 @@ static void (*handler[LASTEvent])(XEvent*) = {
int dwm_main()
{
if (!XSupportsLocale()) {
warning("no locale support in X");
}
if (!(dpy = XOpenDisplay(NULL))) {
fatal("cannot open display");
}
@ -297,11 +301,6 @@ int dwm_main()
return EXIT_SUCCESS;
}
bool dwm_has_locale_support()
{
return XSupportsLocale();
}
/************************************
* Private function implementations *
************************************/

View file

@ -1,9 +1,6 @@
#ifndef _DWM_H
#define _DWM_H
#include <stdbool.h>
int dwm_main();
bool dwm_has_locale_support();
#endif // _DWM_H

View file

@ -37,7 +37,7 @@ int main(int argc, char *argv[])
fatal("no program executable name");
}
if (!setlocale(LC_CTYPE, "") || !dwm_has_locale_support()) {
if (!setlocale(LC_CTYPE, "")) {
warning("no locale support");
}