Don't focus on popup

This commit is contained in:
2025-04-22 19:21:13 +02:00
parent 68c6dd1a95
commit 722aa34fdf

View File

@@ -10,7 +10,6 @@ import 'package:flutter/gestures.dart';
// TODO: Add an icon to the executable, simply use the existing tray icon // TODO: Add an icon to the executable, simply use the existing tray icon
// TODO: Sound does not play when ran from a different workdir? Weird // TODO: Sound does not play when ran from a different workdir? Weird
// TODO: Don't focus on open, playing the sound is enough; We don't want to get killed in games because of journaler
// Default values - will be replaced by DB values if they exist // Default values - will be replaced by DB values if they exist
const Duration _defaultPopupInterval = Duration(minutes: 20); const Duration _defaultPopupInterval = Duration(minutes: 20);
@@ -224,8 +223,6 @@ class MainPageState extends State<MainPage> with WindowListener {
await windowManager.setSize(const Size(1600, 900)); await windowManager.setSize(const Size(1600, 900));
await windowManager.center(); await windowManager.center();
await windowManager.show(); await windowManager.show();
await windowManager.focus();
_currentEntryFocusNode.requestFocus();
await _playSound(); await _playSound();
} else { } else {
await windowManager.focus(); await windowManager.focus();
@@ -239,7 +236,7 @@ class MainPageState extends State<MainPage> with WindowListener {
await _audioPlayer.play(AssetSource('sounds/$_currentNotificationSound')); await _audioPlayer.play(AssetSource('sounds/$_currentNotificationSound'));
debugPrint("Played sound: $_currentNotificationSound"); debugPrint("Played sound: $_currentNotificationSound");
} catch (e) { } catch (e) {
debugPrint("Error playing sound $_currentNotificationSound: e"); debugPrint("Error playing sound $_currentNotificationSound: $e");
} }
} }