Skip to content

Commit

Permalink
fix(macOS): Exit button in tray menu only hide window (#158)
Browse files Browse the repository at this point in the history
* fix(macOS): Exit button in tray menu only hide window

* lint: fix cargo clippy

* lint: cargo fmt
XMLHexagram authored Dec 3, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 1575475 commit 9c1782b
Showing 2 changed files with 21 additions and 9 deletions.
22 changes: 14 additions & 8 deletions analysis/src/shared_utils/audio_metadata_reader.rs
Original file line number Diff line number Diff line change
@@ -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
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';

@@ -40,7 +41,12 @@ class CloseManager {

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

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

0 comments on commit 9c1782b

Please sign in to comment.