From 2fe700fd2c36f736751e8becc3c289ae4ec4015c Mon Sep 17 00:00:00 2001 From: Elijah Semyonov Date: Wed, 10 Jul 2024 15:55:29 +0200 Subject: [PATCH] Truly avoid conversion shenanigans --- .../src/awtMain/objectiveC/macos/DisplayLinkThrottler.mm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/skiko/src/awtMain/objectiveC/macos/DisplayLinkThrottler.mm b/skiko/src/awtMain/objectiveC/macos/DisplayLinkThrottler.mm index 7edc8cf45..4fdc6c97b 100644 --- a/skiko/src/awtMain/objectiveC/macos/DisplayLinkThrottler.mm +++ b/skiko/src/awtMain/objectiveC/macos/DisplayLinkThrottler.mm @@ -123,9 +123,9 @@ - (void)updateDisplayLink { } else { if (_displayLink) { // if display link is present, check if it's for the correct screen, avoid conversion shenanigans - int64_t currentScreenID = _currentScreenID; + int64_t displayLinkScreenID = _displayLinkScreenID; - if (_displayLinkScreenID != currentScreenID) { + if (displayLinkScreenID != currentScreenID) { [self createDisplayLink]; } } else { @@ -183,6 +183,8 @@ - (void)invalidateDisplayLink { CVDisplayLinkStop(_displayLink); CVDisplayLinkRelease(_displayLink); _displayLink = nil; + + NSLog(@"DisplayLinkThrottler: Display link invalidated for screen %lld", _displayLinkScreenID); } } @@ -224,6 +226,8 @@ - (void)createDisplayLink { } _displayLinkScreenID = _currentScreenID; + + NSLog(@"DisplayLinkThrottler: Display link created for screen %lld", _displayLinkScreenID); } - (void)dealloc {