Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove macOS display refresh rate support #2628

Merged
merged 10 commits into from
Feb 6, 2025
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## Unreleased

### Other

- Remove macOS display refresh rate support ([#2628](https://github.com/getsentry/sentry-dart/pull/2628))
denrase marked this conversation as resolved.
Show resolved Hide resolved
- Can't reliably detect on multi-monitor systems and on older macOS versions.
- Not very meaningful, as other applications may be running in parallel and affecting it.

## 8.13.0

### Breaking changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -741,29 +741,7 @@ public class SentryFlutterPlugin: NSObject, FlutterPlugin {
}
#elseif os(macOS)
private func displayRefreshRate(_ result: @escaping FlutterResult) {
// We don't use CADisplayLink for macOS because it's only available starting with macOS 14
guard let window = NSApplication.shared.keyWindow else {
result(nil)
return
}

guard let screen = window.screen else {
result(nil)
return
}

guard let displayID =
screen.deviceDescription[NSDeviceDescriptionKey("NSScreenNumber")] as? CGDirectDisplayID else {
result(nil)
return
}

guard let mode = CGDisplayCopyDisplayMode(displayID) else {
result(nil)
return
}

result(Int(mode.refreshRate))
result(nil)
}
#endif

Expand Down
Loading