mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 21:14:35 +00:00
Cleanup of #493.
This commit is contained in:
parent
4277e9f5d6
commit
c5099ff407
@ -64,6 +64,7 @@ GLFW bundles a number of dependencies in the `deps/` directory.
|
|||||||
|
|
||||||
- Bugfix: Initialization failed on headless systems
|
- Bugfix: Initialization failed on headless systems
|
||||||
- Bugfix: The cached current context could get out of sync
|
- Bugfix: The cached current context could get out of sync
|
||||||
|
- [Cocoa] Bugfix: The cached `NSScreen` for a monitor could get out of sync
|
||||||
|
|
||||||
|
|
||||||
## Contact
|
## Contact
|
||||||
@ -102,6 +103,7 @@ skills.
|
|||||||
- Doug Binks
|
- Doug Binks
|
||||||
- blanco
|
- blanco
|
||||||
- Martin Capitanio
|
- Martin Capitanio
|
||||||
|
- Chi-kwan Chan
|
||||||
- Lambert Clara
|
- Lambert Clara
|
||||||
- Andrew Corrigan
|
- Andrew Corrigan
|
||||||
- Noel Cower
|
- Noel Cower
|
||||||
|
@ -32,20 +32,16 @@
|
|||||||
#include <crt_externs.h>
|
#include <crt_externs.h>
|
||||||
|
|
||||||
|
|
||||||
// Returns the screen that is specified by a displayID
|
// Returns the NSScreen corresponding to the specified CGDirectDisplayID
|
||||||
//
|
//
|
||||||
static NSScreen *getScreen(CGDirectDisplayID displayID)
|
static NSScreen* getScreen(CGDirectDisplayID displayID)
|
||||||
{
|
{
|
||||||
// NOTE: Apple's documentation of [NSScreen screens] mentions that,
|
NSArray* screens = [NSScreen screens];
|
||||||
// "The (screens) array should not be cached. Screens can be
|
|
||||||
// added, removed, or dynamically reconfigured at any time."
|
|
||||||
// Because of this, we simply obtain the screen from a
|
|
||||||
// displayID whenever we need it.
|
|
||||||
NSArray *screens = [NSScreen screens];
|
|
||||||
|
|
||||||
for(NSScreen *screen in screens) {
|
for (NSScreen* screen in screens)
|
||||||
NSDictionary *dictionary = [screen deviceDescription];
|
{
|
||||||
NSNumber *number = [dictionary objectForKey:@"NSScreenNumber"];
|
NSDictionary* dictionary = [screen deviceDescription];
|
||||||
|
NSNumber* number = [dictionary objectForKey:@"NSScreenNumber"];
|
||||||
if ([number unsignedIntegerValue] == displayID)
|
if ([number unsignedIntegerValue] == displayID)
|
||||||
return screen;
|
return screen;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user