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

Enable high framerate #737

Merged
merged 1 commit into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/assets/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- feat: use better colors for the toggle switches in the settings (@gitstart)
- feat(desktop): support pasting from clipboard (@gitstart, @Tienisto)
- feat(linux): allow disabling client side decorations on Wayland (@I-Want-ToBelieve)
- feat(android): use high framerate on devices that lock at 60 Hz like on some OnePlus phones (@Tienisto)
- fix(desktop): fallback to "$HOME/Downloads" when default downloads folder is unavailable (@Sqbika)

## 1.11.1 (2023-09-04)
Expand Down
9 changes: 9 additions & 0 deletions app/lib/init.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'dart:io';

import 'package:dart_mappable/dart_mappable.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_displaymode/flutter_displaymode.dart';
import 'package:localsend_app/constants.dart';
import 'package:localsend_app/gen/strings.g.dart';
import 'package:localsend_app/model/dto/file_dto.dart';
Expand Down Expand Up @@ -129,6 +130,14 @@ StreamSubscription? _sharedMediaSubscription;
Future<void> postInit(BuildContext context, Ref ref, bool appStart, void Function(int) goToPage) async {
await updateSystemOverlayStyle(context);

if (checkPlatform([TargetPlatform.android])) {
try {
await FlutterDisplayMode.setHighRefreshRate();
} catch (e) {
_logger.warning('Setting high refresh rate failed', e);
}
}

try {
await ref.notifier(serverProvider).startServerFromSettings();
} catch (e) {
Expand Down
8 changes: 8 additions & 0 deletions app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,14 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_displaymode:
dependency: "direct main"
description:
name: flutter_displaymode
sha256: "42c5e9abd13d28ed74f701b60529d7f8416947e58256e6659c5550db719c57ef"
url: "https://pub.dev"
source: hosted
version: "0.6.0"
flutter_gen_core:
dependency: transitive
description:
Expand Down
1 change: 1 addition & 0 deletions app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ dependencies:
file_selector: 1.0.1
flutter:
sdk: flutter
flutter_displaymode: 0.6.0
flutter_localizations:
sdk: flutter
flutter_markdown: 0.6.18
Expand Down