|
18 | 18 | #else |
19 | 19 | #defineUNUSED_ON_NON_WINDOWS Py_UNUSED |
20 | 20 | #endif |
| 21 | +#ifdef __APPLE__ |
| 22 | +// Defined in _objc_internal_utils.m. |
| 23 | +extern"C" { |
| 24 | +int_macos_display_is_valid(void); |
| 25 | +} |
| 26 | +#endif |
21 | 27 |
|
22 | 28 | namespacepy= pybind11; |
23 | 29 | usingnamespacepybind11::literals; |
@@ -69,6 +75,8 @@ mpl_display_is_valid(void) |
69 | 75 | } |
70 | 76 | } |
71 | 77 | returnfalse; |
| 78 | +#elif defined(__APPLE__) |
| 79 | +return_macos_display_is_valid() ==1; |
72 | 80 | #else |
73 | 81 | returntrue; |
74 | 82 | #endif |
@@ -180,6 +188,8 @@ PYBIND11_MODULE(_c_internal_utils, m) |
180 | 188 | succeeds, or $WAYLAND_DISPLAY is set and wl_display_connect(NULL) |
181 | 189 | succeeds. |
182 | 190 |
|
| 191 | + On macOS, returns True if NSScreen::mainScreen is not nil. |
| 192 | +
|
183 | 193 | On other platforms, always returns True.)"""); |
184 | 194 | m.def( |
185 | 195 | "Win32_GetCurrentProcessExplicitAppUserModelID", |
|