Fix: generic locale fallback on all platforms when language is unavailable
Move the locale fallback chain out of the #ifdef __linux__ block so it
applies on macOS and Windows too. Add a base-language fallback step that
strips the region code (e.g. en_IL -> en) before trying the full
fallback chain (current locale, system, best, en_US, en_UK).
Previously, if wxLocale::IsAvailable() failed on non-Linux, the app
would show an error and exit. Now it gracefully falls back to a working
locale.
Co-authored-by: SoftFever <softfeverever@gmail.com>
# Description
Upgrade wxWidgets to the latest 3.3.2.
The wxWidgets team mentioned that while 3.3 is not labeled “stable,” it
is production-ready. It isn’t labeled “stable” only because it may
introduce breaking ABI/API changes. As Linux distros are moving to
Wayland, and given the number of fixes in wxWidgets to improve Wayland
support, it’s worth upgrading to 3.3.2 instead of staying on 3.2.x.
Note:
I didn’t switch the dark mode implementation to wxWidgets for two
reasons:
1. To avoid broader changes, since the current dark mode works well with
wxWidgets 3.3.2.
2. wxWidgets dark mode doesn’t support changing themes on the fly; it
requires an application restart for the change to take effect.
# Screenshots/Recordings/Graphs
<!--
> Please attach relevant screenshots to showcase the UI changes.
> Please attach images that can help explain the changes.
-->
## Tests
<!--
> Please describe the tests that you have conducted to verify the
changes made in this PR.
-->
Commit ed88cbe removed `new WebViewWebKit` on macOS because wx 3.3
dropped the no-arg wxWebViewWebKit constructor, falling through to
wxWebView::New(). That bypassed the WebViewWebKit destructor that calls
RemoveScriptMessageHandler("wx"), reintroducing the WebKit teardown bug
the subclass was added to fix.
Restore the macOS-specific subclass path by adding a constructor that
forwards to the wx 3.3 wxWebViewConfiguration-based ctor.
wxWidgets 3.3.2 changed MSWGetStyle to add WS_CAPTION when
wxMINIMIZE_BOX/wxMAXIMIZE_BOX/wxCLOSE_BOX is set. This caused
DefWindowProc to subtract the caption height in WM_NCCALCSIZE for
maximized windows, shrinking the client area and creating a gap
above the taskbar.
Fix by handling WM_NCCALCSIZE for the maximized case explicitly
(strip only border overshoot, not caption) and removing the now
unnecessary wxEVT_MAXIMIZE workaround.
On Linux/GTK, CheckBox, RadioBox, and SwitchButton set their size to
exactly the bitmap size (18x18 or 16x16), but GTK's internal CSS padding
requires additional space, resulting in negative content width warnings.
Use GetBestSize() on GTK to account for theme padding.
wxWidgets 3.3 cmake install doesn't include private headers.
OrcaSlicer uses some private headers for accessibility support.
Add a post-install step to copy the private headers directory.
wxWidgets 3.3 bundles its own NanoSVG in bmpsvg.cpp, conflicting with
OrcaSlicer's bundled copy which includes the nsvgRasterizeXY extension.
Set wxUSE_NANOSVG=OFF in deps cmake to use OrcaSlicer's version only.
- Plater: use Add() instead of wxArrayString(size_t, wxString) ctor
- Search: change sep from std::wstring to wxString for concatenation
- SendMultiMachinePage: replace wxList::Node* with compatibility_iterator
(Node type removed in wx 3.3 with wxUSE_STD_CONTAINERS=ON)
- PhysicalPrinterDialog: disambiguate set_values() call with explicit
std::vector<std::string> (wxArrayString now also matches initializer list)
- Preferences: use ToStdString() instead of mb_str() for std::string comparison
- Plater: use wxString::FromUTF8() for wxArrayString constructor argument