fix: disable tray manager on linux

This commit is contained in:
Tien Do Nam
2023-01-26 11:45:19 +01:00
parent cec8ce2726
commit 53b1899aec
7 changed files with 21 additions and 18 deletions
+9 -7
View File
@@ -103,13 +103,15 @@ class _SettingsTabState extends ConsumerState<SettingsTab> {
),
),
if (checkPlatformIsDesktop()) ...[
_BooleanEntry(
label: t.settingsTab.general.minimizeToTray,
value: settings.minimizeToTray,
onChanged: (b) async {
await ref.read(settingsProvider.notifier).setMinimizeToTray(b);
},
),
if (checkPlatform([TargetPlatform.windows, TargetPlatform.macOS])) ...[
_BooleanEntry(
label: t.settingsTab.general.minimizeToTray,
value: settings.minimizeToTray,
onChanged: (b) async {
await ref.read(settingsProvider.notifier).setMinimizeToTray(b);
},
),
],
if (checkPlatform([TargetPlatform.windows])) ...[
_SettingsEntry(
label: t.settingsTab.general.launchAtStartup,
+1 -1
View File
@@ -10,7 +10,7 @@ enum TrayEntry {
}
Future<void> initTray() async {
if (!checkPlatformIsDesktop()) {
if (!checkPlatform([TargetPlatform.windows, TargetPlatform.macOS])) {
return;
}
try {
@@ -8,7 +8,6 @@
#include <desktop_drop/desktop_drop_plugin.h>
#include <screen_retriever/screen_retriever_plugin.h>
#include <tray_manager/tray_manager_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h>
#include <window_manager/window_manager_plugin.h>
@@ -19,9 +18,6 @@ void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) screen_retriever_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverPlugin");
screen_retriever_plugin_register_with_registrar(screen_retriever_registrar);
g_autoptr(FlPluginRegistrar) tray_manager_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "TrayManagerPlugin");
tray_manager_plugin_register_with_registrar(tray_manager_registrar);
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
-1
View File
@@ -5,7 +5,6 @@
list(APPEND FLUTTER_PLUGIN_LIST
desktop_drop
screen_retriever
tray_manager
url_launcher_linux
window_manager
)
+1 -1
View File
@@ -48,7 +48,7 @@ static void my_application_activate(GApplication* application) {
}
gtk_window_set_default_size(window, 400, 500);
gtk_widget_realize(GTK_WIDGET(window));
gtk_widget_show(GTK_WIDGET(window));
g_autoptr(FlDartProject) project = fl_dart_project_new();
fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments);
+5 -3
View File
@@ -1132,9 +1132,11 @@ packages:
tray_manager:
dependency: "direct main"
description:
name: tray_manager
url: "https://pub.dartlang.org"
source: hosted
path: "."
ref: b37f5e088e0f02c45a684ae41e9d2da2d5c596db
resolved-ref: b37f5e088e0f02c45a684ae41e9d2da2d5c596db
url: "https://github.com/Tienisto/tray_manager.git"
source: git
version: "0.2.0"
typed_data:
dependency: transitive
+5 -1
View File
@@ -40,7 +40,11 @@ dependencies:
shelf_router: 1.1.3
slang: 3.9.0
slang_flutter: 3.9.0
tray_manager: 0.2.0
tray_manager:
# https://github.com/leanflutter/tray_manager/issues/30
git:
url: https://github.com/Tienisto/tray_manager.git
ref: b37f5e088e0f02c45a684ae41e9d2da2d5c596db
url_launcher: 6.1.7
uuid: 3.0.7
wakelock: 0.6.2