Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 88813fc

Browse files
authored
Merge pull request #22240 from dstansby/osx-version
Add minimum macosx version
2 parents 2e5c64b + 152e9c7 commit 88813fc

File tree

4 files changed

+8
-38
lines changed

4 files changed

+8
-38
lines changed

.github/workflows/cibuildwheel.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
runs-on: ${{ matrix.os }}
3131
env:
3232
CIBW_ARCHS_MACOS: "x86_64 universal2 arm64"
33+
MACOSX_DEPLOYMENT_TARGET: "10.12"
3334
strategy:
3435
matrix:
3536
os: [ubuntu-18.04, windows-latest, macos-10.15]

doc/devel/dependencies.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ and the capabilities they provide.
4747
* pycairo_ (>= 1.11.0) or cairocffi_ (>= 0.8): for the GTK and/or cairo-based
4848
backends.
4949
* Tornado_ (>=5): for the WebAgg backend.
50+
* macOS (>=10.12): for the macosx backend.
5051

5152
.. _Tk: https://docs.python.org/3/library/tk.html
5253
.. _PyQt5: https://pypi.org/project/PyQt5/
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
New minimum macOS version
2+
-------------------------
3+
The macosx backend now requires macOS >= 10.12.

src/_macosx.m

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -11,40 +11,9 @@
1111

1212
/* Proper way to check for the OS X version we are compiling for, from
1313
* https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/cross_development/Using/using.html
14-
*/
15-
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
16-
#define COMPILING_FOR_10_7
17-
#endif
1814
19-
/* Renamed symbols cause deprecation warnings, so define macros for the new
15+
* Renamed symbols cause deprecation warnings, so define macros for the new
2016
* names if we are compiling on an older SDK */
21-
#if __MAC_OS_X_VERSION_MIN_REQUIRED < 101000
22-
#define NSModalResponseOK NSOKButton
23-
#endif
24-
#if __MAC_OS_X_VERSION_MIN_REQUIRED < 101200
25-
#define NSEventMaskAny NSAnyEventMask
26-
#define NSEventTypeApplicationDefined NSApplicationDefined
27-
#define NSEventModifierFlagCommand NSCommandKeyMask
28-
#define NSEventModifierFlagControl NSControlKeyMask
29-
#define NSEventModifierFlagOption NSAlternateKeyMask
30-
#define NSEventModifierFlagShift NSShiftKeyMask
31-
#define NSEventTypeKeyUp NSKeyUp
32-
#define NSEventTypeKeyDown NSKeyDown
33-
#define NSEventTypeMouseMoved NSMouseMoved
34-
#define NSEventTypeLeftMouseDown NSLeftMouseDown
35-
#define NSEventTypeRightMouseDown NSRightMouseDown
36-
#define NSEventTypeOtherMouseDown NSOtherMouseDown
37-
#define NSEventTypeLeftMouseDragged NSLeftMouseDragged
38-
#define NSEventTypeRightMouseDragged NSRightMouseDragged
39-
#define NSEventTypeOtherMouseDragged NSOtherMouseDragged
40-
#define NSEventTypeLeftMouseUp NSLeftMouseUp
41-
#define NSEventTypeRightMouseUp NSRightMouseUp
42-
#define NSEventTypeOtherMouseUp NSOtherMouseUp
43-
#define NSWindowStyleMaskClosable NSClosableWindowMask
44-
#define NSWindowStyleMaskMiniaturizable NSMiniaturizableWindowMask
45-
#define NSWindowStyleMaskResizable NSResizableWindowMask
46-
#define NSWindowStyleMaskTitled NSTitledWindowMask
47-
#endif
4817
#if __MAC_OS_X_VERSION_MIN_REQUIRED < 101400
4918
#define NSButtonTypeMomentaryLight NSMomentaryLightButton
5019
#define NSButtonTypePushOnPushOff NSPushOnPushOffButton
@@ -895,9 +864,7 @@ -(void)save_figure:(id)sender { gil_call_method(toolbar, "save_figure"); }
895864
NSSize scale;
896865

897866
rect = NSMakeRect(0, 0, imagesize, imagesize);
898-
#ifdef COMPILING_FOR_10_7
899867
rect = [window convertRectToBacking: rect];
900-
#endif
901868
size = rect.size;
902869
scale = NSMakeSize(imagesize / size.width, imagesize / size.height);
903870

@@ -934,10 +901,8 @@ -(void)save_figure:(id)sender { gil_call_method(toolbar, "save_figure"); }
934901
rect.size.height = 0;
935902
rect.origin.x += height;
936903
NSTextView* messagebox = [[NSTextView alloc] initWithFrame: rect];
937-
if (@available(macOS 10.11, *)) {
938-
messagebox.textContainer.maximumNumberOfLines = 2;
939-
messagebox.textContainer.lineBreakMode = NSLineBreakByTruncatingTail;
940-
}
904+
messagebox.textContainer.maximumNumberOfLines = 2;
905+
messagebox.textContainer.lineBreakMode = NSLineBreakByTruncatingTail;
941906
[messagebox setFont: font];
942907
[messagebox setDrawsBackground: NO];
943908
[messagebox setSelectable: NO];

0 commit comments

Comments
 (0)