Skip to content

Commit a5c5ede

Browse files
author
liuchuancong
committed
添加标题
1 parent 5ce96f4 commit a5c5ede

2 files changed

Lines changed: 16 additions & 8 deletions

File tree

.vscode/launch.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
"name": "Flutter with Proxy",
66
"request": "launch",
77
"type": "dart",
8-
"env": {
9-
"http_proxy": "http://127.0.0.1:7890",
10-
"https_proxy": "http://127.0.0.1:7890",
11-
"HTTP_PROXY": "http://127.0.0.1:7890",
12-
"HTTPS_PROXY": "http://127.0.0.1:7890"
13-
}
8+
// "env": {
9+
// "http_proxy": "http://127.0.0.1:7890",
10+
// "https_proxy": "http://127.0.0.1:7890",
11+
// "HTTP_PROXY": "http://127.0.0.1:7890",
12+
// "HTTPS_PROXY": "http://127.0.0.1:7890"
13+
// }
1414
}
1515
]
1616
}

lib/common/global/platform/desktop_manager.dart

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ class DesktopManager {
127127

128128
static Future<void> updateTray() async {
129129
if (!PlatformUtils.isDesktop) return;
130+
131+
await trayManager.setToolTip('纯粹直播');
130132
try {
131133
bool isWindowVisible = await windowManager.isVisible();
132134
Menu menu = Menu(
@@ -173,8 +175,12 @@ class DesktopManager {
173175
if (!PlatformUtils.isDesktop) return;
174176

175177
try {
176-
if (!await windowManager.isVisible()) {
178+
bool isVisible = await windowManager.isVisible();
179+
if (isVisible) {
180+
await windowManager.focus();
181+
} else {
177182
await windowManager.show();
183+
await windowManager.setSkipTaskbar(false);
178184
}
179185
} catch (e) {
180186
debugPrint('托盘图标点击处理失败: $e');
@@ -285,7 +291,9 @@ mixin DesktopWindowMixin<T extends StatefulWidget> on State<T> implements Window
285291

286292
@override
287293
void onTrayIconRightMouseUp() {
288-
trayManager.popUpContextMenu();
294+
windowManager.focus().then((_) {
295+
trayManager.popUpContextMenu();
296+
});
289297
}
290298

291299
@override

0 commit comments

Comments
 (0)