macOS build: universal app for Apple Silicon and Intel, macOS 11+
- scripts/build-wx-macos.sh: static, monolithic, universal (arm64 + x86_64) wxOSX/Cocoa 3.3.3 from the vendored tree, with wx's bundled image/zlib/regex/expat so the app links only system frameworks. Minimum macOS 11.0: current SDKs' libc++ supports nothing older. - scripts/build-gui-macos.sh: builds both Rust targets against that prefix and merges them with lipo. - ci/package-macos.py: "Alkane Toolkit.app" (Info.plist, icon, local network usage string), ad-hoc signed, zipped with ditto as alkane-toolkit-vX.Y.Z-macos-universal.zip with LICENSE and README. - crates/alkane-gui/macos: app icon (.icns) from the same glyph as the Windows icon, plus the script that makes it. - wx-rs patch 0009: macOS goes through wx-config (drops the universal -arch flags, maps -framework), reports logical sizes like GTK/MSW instead of narrowing floats to ints, and links clang's compiler runtime for wxOSX's @available checks. - docs/macos.md, README and the manual's install chapter. Verified on an M1 running macOS 27.0.1: both slices build, all workspace unit tests pass, and the headless UI self-test passes 52/52 on arm64. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+7
-21
@@ -492,21 +492,12 @@ extern "C" {
|
||||
|
||||
// The logical window size
|
||||
Size get_client_size() {
|
||||
#ifdef __APPLE__
|
||||
int status_bar_height;
|
||||
if (wxGetApp().frame->GetStatusBar()) {
|
||||
status_bar_height = wxGetApp().frame->GetStatusBar()->GetRect().height;
|
||||
} else {
|
||||
status_bar_height = 0;
|
||||
}
|
||||
float scale_factor = wxGetApp().frame->GetDPIScaleFactor();
|
||||
wxSize s = wxGetApp().frame->GetClientSize();
|
||||
struct Size sz = {s.x * scale_factor, (s.y + status_bar_height) * scale_factor};
|
||||
return sz;
|
||||
#elif defined(__linux__)
|
||||
// alkane-toolkit patch: wxGTK3 path (upstream only knew Apple vs Windows)
|
||||
#if defined(__linux__) || defined(__APPLE__)
|
||||
// alkane-toolkit patch: wxGTK3 and wxOSX both report logical (DIP) sizes,
|
||||
// like every other bridge size. Upstream's Apple branch scaled to physical
|
||||
// pixels through a float -> int narrowing current clang rejects.
|
||||
wxSize s = wxGetApp().frame->GetClientSize();
|
||||
return Size {(unsigned int)s.x, (unsigned int)s.y};
|
||||
return Size {s.x, s.y};
|
||||
#else
|
||||
HWND hwnd = (HWND) wxGetApp().frame->GetHandle();
|
||||
RECT rect;
|
||||
@@ -559,15 +550,10 @@ extern "C" {
|
||||
}
|
||||
|
||||
Size get_mouse_position(wxMouseEvent &event) {
|
||||
#ifdef __APPLE__
|
||||
wxPoint p = event.GetPosition();
|
||||
float scale_factor = wxGetApp().frame->GetDPIScaleFactor();
|
||||
struct Size s = {p.x * scale_factor, p.y * scale_factor};
|
||||
return s;
|
||||
#else
|
||||
// alkane-toolkit patch: logical (DIP) coordinates on every platform,
|
||||
// matching get_client_size (upstream scaled them on Apple).
|
||||
wxPoint p = event.GetPosition();
|
||||
return Size {p.x, p.y};
|
||||
#endif
|
||||
}
|
||||
|
||||
int get_mouse_wheel_rotation(wxMouseEvent &event) {
|
||||
|
||||
Reference in New Issue
Block a user