From 826c44e660d78029d582c664f7129f6cd21994d3 Mon Sep 17 00:00:00 2001 From: qianlifeng Date: Fri, 1 Dec 2023 23:52:15 +0800 Subject: [PATCH] Fix flutter windows level is not topmost and will not return focus to prev app on macos --- Wox.UI.Flutter/wox/lib/controller.dart | 2 -- Wox.UI.Flutter/wox/macos/Podfile.lock | 2 +- Wox.UI.Flutter/wox/pubspec.lock | 9 +++++---- Wox.UI.Flutter/wox/pubspec.yaml | 5 ++++- Wox/setting/manager.go | 9 +++++++++ 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/Wox.UI.Flutter/wox/lib/controller.dart b/Wox.UI.Flutter/wox/lib/controller.dart index e2dc9f5ea..07f70e47c 100644 --- a/Wox.UI.Flutter/wox/lib/controller.dart +++ b/Wox.UI.Flutter/wox/lib/controller.dart @@ -78,12 +78,10 @@ class WoxController extends GetxController { } await windowManager.show(); - await windowManager.focus(); queryFocusNode.requestFocus(); } Future hide() async { - await windowManager.blur(); await windowManager.hide(); } diff --git a/Wox.UI.Flutter/wox/macos/Podfile.lock b/Wox.UI.Flutter/wox/macos/Podfile.lock index 9fd3eb546..f7efb636a 100644 --- a/Wox.UI.Flutter/wox/macos/Podfile.lock +++ b/Wox.UI.Flutter/wox/macos/Podfile.lock @@ -38,4 +38,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 16208599a12443d53889ba2270a4985981cfb204 -COCOAPODS: 1.11.3 +COCOAPODS: 1.12.1 diff --git a/Wox.UI.Flutter/wox/pubspec.lock b/Wox.UI.Flutter/wox/pubspec.lock index 21f07218c..3f077000c 100644 --- a/Wox.UI.Flutter/wox/pubspec.lock +++ b/Wox.UI.Flutter/wox/pubspec.lock @@ -427,10 +427,11 @@ packages: window_manager: dependency: "direct main" description: - name: window_manager - sha256: dcc865277f26a7dad263a47d0e405d77e21f12cb71f30333a52710a408690bd7 - url: "https://pub.dev" - source: hosted + path: "." + ref: "6f220e952e00f8f3fb3f459cb67e0d08faa752c2" + resolved-ref: "6f220e952e00f8f3fb3f459cb67e0d08faa752c2" + url: "https://github.com/qianlifeng/window_manager.git" + source: git version: "0.3.7" xdg_directories: dependency: transitive diff --git a/Wox.UI.Flutter/wox/pubspec.yaml b/Wox.UI.Flutter/wox/pubspec.yaml index e150b33bf..846ac0235 100644 --- a/Wox.UI.Flutter/wox/pubspec.yaml +++ b/Wox.UI.Flutter/wox/pubspec.yaml @@ -31,7 +31,10 @@ dependencies: flutter: sdk: flutter - window_manager: ^0.3.6 + window_manager: + git: + url: https://github.com/qianlifeng/window_manager.git + ref: 6f220e952e00f8f3fb3f459cb67e0d08faa752c2 web_socket_channel: ^2.4.0 flutter_acrylic: ^1.1.0 get: ^4.6.6 diff --git a/Wox/setting/manager.go b/Wox/setting/manager.go index 989a94358..9fb4e0658 100644 --- a/Wox/setting/manager.go +++ b/Wox/setting/manager.go @@ -242,6 +242,15 @@ func (m *Manager) LoadPluginSetting(ctx context.Context, pluginId string, defaul pluginSetting.Settings = defaultSettings.GetAllDefaults() } + //check if all default settings are present in the plugin settings + //plugin author may add new definitions which are not in the user settings + defaultSettings.GetAllDefaults().Range(func(key string, value string) bool { + if _, exist := pluginSetting.Settings.Load(key); !exist { + pluginSetting.Settings.Store(key, value) + } + return true + }) + return pluginSetting, nil }