mirror of
https://github.com/glfw/glfw.git
synced 2024-11-26 12:02:00 +00:00
Cocoa: Fix duplicate monitor connection events
(cherry picked from commit 5aff72aa00
)
This commit is contained in:
parent
eda12dd949
commit
14921d1e24
@ -338,7 +338,8 @@ void _glfwPollMonitorsNS(void)
|
||||
// display replacement on machines with automatic graphics
|
||||
// switching
|
||||
const uint32_t unitNumber = CGDisplayUnitNumber(displays[i]);
|
||||
for (uint32_t j = 0; j < disconnectedCount; j++)
|
||||
uint32_t j;
|
||||
for (j = 0; j < disconnectedCount; j++)
|
||||
{
|
||||
if (disconnected[j] && disconnected[j]->ns.unitNumber == unitNumber)
|
||||
{
|
||||
@ -347,6 +348,9 @@ void _glfwPollMonitorsNS(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (j < disconnectedCount)
|
||||
continue;
|
||||
|
||||
const CGSize size = CGDisplayScreenSize(displays[i]);
|
||||
char* name = getDisplayName(displays[i]);
|
||||
if (!name)
|
||||
|
Loading…
Reference in New Issue
Block a user