mirror of
https://github.com/glfw/glfw.git
synced 2024-11-26 22:34:35 +00:00
Fix monitor disappearing on OS X with AGS
When automatic graphics switching is activated, the CGDirectDisplayID for the display changes, casuing the primary GLFWmonitor to disappear.
This commit is contained in:
parent
8b2da399ee
commit
e0084617d5
@ -88,6 +88,9 @@ GLFW bundles a number of dependencies in the `deps/` directory.
|
|||||||
- [Cocoa] Bugfix: Cursor creation failed unless a window had been created.
|
- [Cocoa] Bugfix: Cursor creation failed unless a window had been created.
|
||||||
- [Cocoa] Bugfix: Window refresh events were not generated by iconification or
|
- [Cocoa] Bugfix: Window refresh events were not generated by iconification or
|
||||||
restoration
|
restoration
|
||||||
|
- [Cocoa] Bugfix: The primary monitor would get reported as disconnected when
|
||||||
|
entering full screen on a dual-GPU machine with automatic
|
||||||
|
graphics switching
|
||||||
- [X11] Bugfix: `glfwInit` would segfault on systems without RandR
|
- [X11] Bugfix: `glfwInit` would segfault on systems without RandR
|
||||||
- [X11] Bugfix: The response to `_NET_WM_PING` was sent to the wrong window
|
- [X11] Bugfix: The response to `_NET_WM_PING` was sent to the wrong window
|
||||||
- [X11] Bugfix: Character input via XIM did not work in many cases
|
- [X11] Bugfix: Character input via XIM did not work in many cases
|
||||||
|
@ -269,6 +269,7 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count)
|
|||||||
|
|
||||||
monitor = _glfwAllocMonitor(name, size.width, size.height);
|
monitor = _glfwAllocMonitor(name, size.width, size.height);
|
||||||
monitor->ns.displayID = displays[i];
|
monitor->ns.displayID = displays[i];
|
||||||
|
monitor->ns.unitNumber = CGDisplayUnitNumber(displays[i]);
|
||||||
|
|
||||||
free(name);
|
free(name);
|
||||||
|
|
||||||
@ -284,7 +285,9 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count)
|
|||||||
|
|
||||||
GLboolean _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second)
|
GLboolean _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second)
|
||||||
{
|
{
|
||||||
return first->ns.displayID == second->ns.displayID;
|
// HACK: Compare unit numbers instead of display IDs to work around display
|
||||||
|
// replacement on machines with automatic graphics switching
|
||||||
|
return first->ns.unitNumber == second->ns.unitNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor, int* xpos, int* ypos)
|
void _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor, int* xpos, int* ypos)
|
||||||
|
@ -90,6 +90,7 @@ typedef struct _GLFWmonitorNS
|
|||||||
{
|
{
|
||||||
CGDirectDisplayID displayID;
|
CGDirectDisplayID displayID;
|
||||||
CGDisplayModeRef previousMode;
|
CGDisplayModeRef previousMode;
|
||||||
|
uint32_t unitNumber;
|
||||||
|
|
||||||
} _GLFWmonitorNS;
|
} _GLFWmonitorNS;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user