hiro/qt: Fixes in Application::initialize

- Call XInitThreads at initialization
- Remove spaces from screensaver window name
- Restore LC_NUMERIC after Qt clobbers it

This is sourced from ares v116r07, and:
6cd4470562

Co-authored-by: Near <77224854+near-san@users.noreply.github.com>
Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
This commit is contained in:
John Chadwick 2025-09-01 19:31:36 -04:00 committed by Screwtapello
parent ad259a55c0
commit b424c4b2f7
1 changed files with 7 additions and 1 deletions

View File

@ -90,6 +90,7 @@ auto pApplication::initialize() -> void {
#endif
#if defined(DISPLAY_XORG)
XInitThreads();
state().display = XOpenDisplay(nullptr);
state().screenSaverXDG = (bool)execute("xdg-screensaver", "--version").output.find("xdg-screensaver");
@ -105,7 +106,7 @@ auto pApplication::initialize() -> void {
InputOutput, DefaultVisual(state().display, screen),
CWBackPixel | CWBorderPixel | CWOverrideRedirect, &attributes
);
XStoreName(state().display, state().screenSaverWindow, "hiro screensaver-prevention window");
XStoreName(state().display, state().screenSaverWindow, "hiro-screen-saver-window");
XFlush(state().display);
}
#endif
@ -119,6 +120,11 @@ auto pApplication::initialize() -> void {
static char** argvp = argv;
qtApplication = new QApplication(argc, argvp);
// Creating the QApplication causes Qt to set the locale from the environment.
// Set the locale for LC_NUMERIC back to "C". It is expected to be "C" for
// the purpose of various string formatting and parsing operations.
setlocale(LC_NUMERIC, "C");
pKeyboard::initialize();
}