Skip to content

Commit

Permalink
Merge pull request #1599 from atsign-foundation/window-manager
Browse files Browse the repository at this point in the history
fix: window behavior
  • Loading branch information
CurtlyCritchlow authored Dec 6, 2024
2 parents 54302e8 + 140d01d commit 421b2be
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,23 +69,21 @@ class TrayCubit extends LoggingCubit<TrayState> {

(String, void Function(MenuItem)) _getAction(TrayAction action, AppLocalizations localizations) {
return switch (action) {
TrayAction.showDashboard => (localizations.showWindow, (_) => windowManager.focus()),
TrayAction.showDashboard => (localizations.showWindow, (_) => windowManager.show(inactive: true)),
TrayAction.showSettings => (
localizations.settings,
(_) {
windowManager.focus().then((_) {
var context = App.navState.currentContext;
if (context == null) return;
if (context.mounted) {
var cubit = context.read<OnboardingCubit>();
if (cubit.getStatus() != OnboardingStatus.onboarded) return;
Navigator.of(context).pushNamedAndRemoveUntil(
Routes.settings,
(route) => route.isFirst,
);
}
});
}
(_) => windowManager.show(inactive: true).then((_) {
var context = App.navState.currentContext;
if (context == null) return;
if (context.mounted) {
var cubit = context.read<OnboardingCubit>();
if (cubit.getStatus() != OnboardingStatus.onboarded) return;
Navigator.of(context).pushNamedAndRemoveUntil(
Routes.settings,
(route) => route.isFirst,
);
}
})
),
TrayAction.quitApp => (
localizations.quit,
Expand Down
7 changes: 2 additions & 5 deletions packages/dart/npt_flutter/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:npt_flutter/constants.dart';
import 'package:window_manager/window_manager.dart';
Expand All @@ -9,11 +7,10 @@ import 'app.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();

var windowOptions = WindowOptions(
var windowOptions = const WindowOptions(
title: "NoPorts Desktop",
minimumSize: Constants.kWindowsMinWindowSize,
skipTaskbar: Platform.isWindows,
alwaysOnTop: true,
skipTaskbar: false,
);
windowManager.ensureInitialized();
windowManager.waitUntilReadyToShow(windowOptions);
Expand Down
2 changes: 1 addition & 1 deletion packages/dart/npt_flutter/macos/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367

COCOAPODS: 1.14.3
COCOAPODS: 1.15.2
6 changes: 3 additions & 3 deletions packages/dart/npt_flutter/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.1.2+2
version: 1.1.3+0

environment:
sdk: ^3.5.0
Expand Down Expand Up @@ -134,10 +134,10 @@ flutter:

msix_config:
display_name: "NoPorts Desktop"
publisher_display_name: Atsign
publisher_display_name: Atsign Inc
identity_name: TheCompany.NoPortsDesktop
publisher: CN=BBFE1D0B-F713-4C7F-B375-5EA851CBB1FF
msix_version: 1.1.2.0
msix_version: 1.1.3.0
logo_path: "assets/logo.png"
capabilities: internetClient
store: true
Expand Down

0 comments on commit 421b2be

Please sign in to comment.