Skip to content

Commit

Permalink
Truly avoid conversion shenanigans
Browse files Browse the repository at this point in the history
  • Loading branch information
elijah-semyonov committed Jul 10, 2024
1 parent 9924abb commit 2fe700f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions skiko/src/awtMain/objectiveC/macos/DisplayLinkThrottler.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -183,6 +183,8 @@ - (void)invalidateDisplayLink {
CVDisplayLinkStop(_displayLink);
CVDisplayLinkRelease(_displayLink);
_displayLink = nil;

NSLog(@"DisplayLinkThrottler: Display link invalidated for screen %lld", _displayLinkScreenID);
}
}

Expand Down Expand Up @@ -224,6 +226,8 @@ - (void)createDisplayLink {
}

_displayLinkScreenID = _currentScreenID;

NSLog(@"DisplayLinkThrottler: Display link created for screen %lld", _displayLinkScreenID);
}

- (void)dealloc {
Expand Down

0 comments on commit 2fe700f

Please sign in to comment.