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

fix(macOS): Exit button in tray menu only hide window #158

Merged
merged 3 commits into from
Dec 3, 2024
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
22 changes: 14 additions & 8 deletions analysis/src/shared_utils/audio_metadata_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,20 @@ pub fn get_format(file_path: &str) -> Result<Box<dyn FormatReader>> {
}

pub fn get_codec_information(track: &Track) -> Result<(u32, f64), symphonia::core::errors::Error> {
let sample_rate = track
.codec_params
.sample_rate
.ok_or_else(|| symphonia::core::errors::Error::Unsupported("No sample rate found"))?;
let duration = track
.codec_params
.n_frames
.ok_or_else(|| symphonia::core::errors::Error::Unsupported("No duration found"))?;
let sample_rate =
track
.codec_params
.sample_rate
.ok_or(symphonia::core::errors::Error::Unsupported(
"No sample rate found",
))?;
let duration =
track
.codec_params
.n_frames
.ok_or(symphonia::core::errors::Error::Unsupported(
"No duration found",
))?;

let time_base = track
.codec_params
Expand Down
8 changes: 7 additions & 1 deletion lib/utils/close_manager.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:io';

import 'package:bitsdojo_window/bitsdojo_window.dart';
import 'package:flutter/services.dart';
import 'package:local_notifier/local_notifier.dart';
import 'package:flutter_window_close/flutter_window_close.dart';

Expand Down Expand Up @@ -40,7 +41,12 @@ class CloseManager {

close() {
forceClose = true;
appWindow.close();

if (Platform.isMacOS) {
SystemNavigator.pop();
} else {
appWindow.close();
}
}
}

Expand Down
Loading