mirror of https://github.com/bsnes-emu/bsnes
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:
parent
ad259a55c0
commit
b424c4b2f7
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue