Cocoa: Fix code to shutdown display link for inactive monitors
This commit is contained in:
parent
3e0f4d36bc
commit
eb30ba7722
@ -95,17 +95,13 @@ requestRenderFrame(_GLFWwindow *w, GLFWcocoarenderframefun callback) {
|
|||||||
_GLFWDisplayLinkNS *dl = &_glfw.ns.displayLinks.entries[i];
|
_GLFWDisplayLinkNS *dl = &_glfw.ns.displayLinks.entries[i];
|
||||||
if (dl->displayID == displayID) {
|
if (dl->displayID == displayID) {
|
||||||
dl->lastRenderFrameRequestedAt = now;
|
dl->lastRenderFrameRequestedAt = now;
|
||||||
if (!CVDisplayLinkIsRunning(dl->displayLink)) {
|
if (!CVDisplayLinkIsRunning(dl->displayLink)) CVDisplayLinkStart(dl->displayLink);
|
||||||
CVDisplayLinkStart(dl->displayLink);
|
} else if (dl->displayLink && dl->lastRenderFrameRequestedAt && now - dl->lastRenderFrameRequestedAt >= DISPLAY_LINK_SHUTDOWN_CHECK_INTERVAL) {
|
||||||
} else {
|
CVDisplayLinkStop(dl->displayLink);
|
||||||
if (dl->lastRenderFrameRequestedAt && now - dl->lastRenderFrameRequestedAt) {
|
|
||||||
if (dl->displayLink) CVDisplayLinkStop(dl->displayLink);
|
|
||||||
dl->lastRenderFrameRequestedAt = 0;
|
dl->lastRenderFrameRequestedAt = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_glfwRestartDisplayLinks(void) {
|
_glfwRestartDisplayLinks(void) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user