Commit 667256a
committed
dispserv_apple: gate CoreGraphics umbrella and CGDisplayMode APIs
gfx/display_servers/dispserv_apple.m hits two separate SDK cliffs on
pre-10.8 macOS builds:
dispserv_apple.m:31:38: error:
CoreGraphics/CoreGraphics.h: No such file or directory
The <CoreGraphics/CoreGraphics.h> umbrella header is 10.8+. Before
that, the framework is reached through <ApplicationServices/
ApplicationServices.h>. Swap based on MAC_OS_X_VERSION_MIN_REQUIRED.
The second, latent issue: CGDisplayModeRef and its accessors
(CGDisplayCopyAllDisplayModes, CGDisplayModeGetWidth/Height,
CGDisplaySetDisplayMode) all arrived in 10.6 Snow Leopard. The 10.5
SDK only exposes the older CGDisplayAvailableModes / CFDictionaryRef
path, which is a different enough shape that porting to both isn't
worth it for a driver whose job is mostly resolution switching.
Introduce RARCH_HAS_CGDISPLAYMODE_API (defined on 10.6+ SDKs) and
gate:
- get_resolution_list OSX branch (modern path kept; fallback
reports the current mode as a single entry using the
pre-10.0 CGDisplayPixelsWide/High APIs)
- apple_display_server_t.original_mode / display_id fields
- init block that saves the original display mode
- destroy block that restores it
apple_display_server_set_resolution needs no change — it was
already gated on __MAC_OS_X_VERSION_MAX_ALLOWED >= 140000 (macOS
14 Sonoma).
Pre-10.6 targets lose resolution-switching but keep window
opacity/progress/decorations. Modern macOS builds see no change.1 parent f88e39a commit 667256a
1 file changed
Lines changed: 53 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
31 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
32 | 54 | | |
33 | 55 | | |
34 | 56 | | |
| |||
222 | 244 | | |
223 | 245 | | |
224 | 246 | | |
| 247 | + | |
225 | 248 | | |
226 | 249 | | |
227 | 250 | | |
| |||
316 | 339 | | |
317 | 340 | | |
318 | 341 | | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
319 | 369 | | |
320 | 370 | | |
321 | 371 | | |
| |||
438 | 488 | | |
439 | 489 | | |
440 | 490 | | |
441 | | - | |
| 491 | + | |
442 | 492 | | |
443 | 493 | | |
444 | 494 | | |
| |||
450 | 500 | | |
451 | 501 | | |
452 | 502 | | |
453 | | - | |
| 503 | + | |
454 | 504 | | |
455 | 505 | | |
456 | 506 | | |
| |||
503 | 553 | | |
504 | 554 | | |
505 | 555 | | |
506 | | - | |
| 556 | + | |
507 | 557 | | |
508 | 558 | | |
509 | 559 | | |
| |||
0 commit comments