Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set fixed locale for numbers near config read/write #15782

Merged
merged 1 commit into from
Oct 31, 2023

Conversation

zoltanvb
Copy link
Contributor

Description

Force a fixed locale for numbers. This is a fallback measure when a rogue library modifies the locale, which should be "C" by default.

Related Issues

#15756
In this particular issue, the chain was wayland -> libdecor -> gtk plugin -> setlocale(LC_ALL, "")

There may be some other issues related to this, as the error causes bad reading/writing of floats, leading to all sorts of weird controller setups.

@nfp0
Copy link
Contributor

nfp0 commented Oct 10, 2023

This has just been fixed on liblocale here: https://gitlab.freedesktop.org/libdecor/libdecor/-/merge_requests/132
Even with that, does RetroArch still benefit from this change?

@zoltanvb zoltanvb changed the title Set fixed locale for numbers on startup Draft: Set fixed locale for numbers on startup Oct 10, 2023
@zoltanvb zoltanvb changed the title Draft: Set fixed locale for numbers on startup Set fixed locale for numbers near config read/write Oct 15, 2023
@zoltanvb
Copy link
Contributor Author

As discussed under the issue, this change in the current form will avoid the libdecor related problem. Full solution would be locale independent read/write, that is a bigger undertaking, but maybe the issue could remain open as a reminder.

@nfp0
Copy link
Contributor

nfp0 commented Oct 16, 2023

This might be of interest for this issue:
When using RetroArch on tag v1.16.0.3 and using the fixed libdecor (haven't tested any other combination), I get the following warning:

(retroarch:277159): Gtk-WARNING **: 22:28:54.500: gtk_disable_setlocale() must be called before gtk_init()

@zoltanvb
Copy link
Contributor Author

I do not see a way how to avoid the warning from RA, unfortunately. Gtk is not used directly from this codebase.

Move setlocale() closer to config file read/write.
@zoltanvb
Copy link
Contributor Author

Change is now limited to the problematic configuration.

@LibretroAdmin
Copy link
Contributor

Sorry for the long wait.

@LibretroAdmin LibretroAdmin merged commit 2320957 into libretro:master Oct 31, 2023
22 checks passed
JoeOsborn pushed a commit to JoeOsborn/RetroArch that referenced this pull request Nov 2, 2023
)

Move setlocale() closer to config file read/write.
@Chandler-Kluser
Copy link

Same thing here

retroarch --version
RetroArch - Frontend for libretro
Version: 1.16.0 (Git 3186b1dce3) Nov  5 2023
Compiler: GCC (13.2.1) 64-bit
neofetch
                   -`                    chandler@pc-quarto 
                  .o+`                   ------------------ 
                 `ooo/                   OS: Arch Linux x86_64 
                `+oooo:                  Host: B450 I AORUS PRO WIFI 
               `+oooooo:                 Kernel: 6.6.8-arch1-1 
               -+oooooo+:                Uptime: 7 days, 6 hours, 50 mins 
             `/:-:++oooo+:               Packages: 1852 (pacman) 
            `/++++/+++++++:              Shell: zsh 5.9 
           `/++++++++++++++:             Resolution: 3840x2160 
          `/+++ooooooooooooo/`           DE: GNOME 45.2 
         ./ooosssso++osssssso+`          WM: Mutter 
        .oossssso-````/ossssss+`         WM Theme: Adwaita 
       -osssssso.      :ssssssso.        Theme: HighContrastInverse [GTK2/3] 
      :osssssss/        osssso+++.       Icons: Adwaita [GTK2/3] 
     /ossssssss/        +ssssooo/-       Terminal: kgx 
   `/ossssso+/:-        -:/+osssso+-     CPU: AMD Ryzen 7 3700X (16) @ 3.600GHz 
  `+sso+:-`                 `.-/+oso:    GPU: AMD ATI Radeon RX 6600/6600 XT/6600M 
 `++:.                           `-/+/   Memory: 4744MiB / 15912MiB 
 .`                                 `/
                                                                 
                                                                 

Sunderland93 pushed a commit to Sunderland93/RetroArch that referenced this pull request Dec 26, 2024
)

Move setlocale() closer to config file read/write.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants