Skip to content

Commit

Permalink
Merge pull request #846 from BayLee4/fix_retina
Browse files Browse the repository at this point in the history
Cocoa Port: Fix mixed retina/non-retina display touchscreen bug
  • Loading branch information
rogerman authored Oct 10, 2024
2 parents 8fa0aff + a0386e5 commit 2bc5b0d
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1465,6 +1465,15 @@ - (void)windowWillClose:(NSNotification *)notification
- (void)windowDidChangeScreen:(NSNotification *)notification
{
[self updateDisplayID];
#if defined(MAC_OS_X_VERSION_10_7) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
NSScreen *screen = [[self window] screen];
// Set up the scaling factor if this is a Retina window
if ([screen respondsToSelector:@selector(backingScaleFactor)])
{
float scaleFactor = [screen backingScaleFactor];
[[[self view] cdsVideoOutput] clientDisplay3DView]->Get3DPresenter()->SetScaleFactor(scaleFactor);
}
#endif
}

#if defined(MAC_OS_X_VERSION_10_7) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
Expand Down

0 comments on commit 2bc5b0d

Please sign in to comment.