mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
opt: add microphone permission tip
This commit is contained in:
@@ -44,6 +44,7 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
||||
var watchIsCanScreenRecording = false;
|
||||
var watchIsProcessTrust = false;
|
||||
var watchIsInputMonitoring = false;
|
||||
var watchIsCanRecordAudio = false;
|
||||
Timer? _updateTimer;
|
||||
|
||||
@override
|
||||
@@ -79,7 +80,16 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
||||
buildTip(context),
|
||||
buildIDBoard(context),
|
||||
buildPasswordBoard(context),
|
||||
buildHelpCards(),
|
||||
FutureBuilder<Widget>(
|
||||
future: buildHelpCards(),
|
||||
builder: (_, data) {
|
||||
if (data.hasData) {
|
||||
return data.data!;
|
||||
} else {
|
||||
return const Offstage();
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -302,7 +312,7 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildHelpCards() {
|
||||
Future<Widget> buildHelpCards() async {
|
||||
if (updateUrl.isNotEmpty) {
|
||||
return buildInstallCard(
|
||||
"Status",
|
||||
@@ -348,6 +358,13 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
||||
return buildInstallCard("", "install_daemon_tip", "Install", () async {
|
||||
bind.mainIsInstalledDaemon(prompt: true);
|
||||
});
|
||||
} else if ((await osxCanRecordAudio() !=
|
||||
PermissionAuthorizeType.authorized)) {
|
||||
return buildInstallCard("Permissions", "config_microphone", "Configure",
|
||||
() async {
|
||||
osxRequestAudio();
|
||||
watchIsCanRecordAudio = true;
|
||||
});
|
||||
}
|
||||
} else if (Platform.isLinux) {
|
||||
if (bind.mainCurrentIsWayland()) {
|
||||
@@ -481,6 +498,20 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
||||
setState(() {});
|
||||
}
|
||||
}
|
||||
if (watchIsCanRecordAudio) {
|
||||
if (Platform.isMacOS) {
|
||||
Future.microtask(() async {
|
||||
if ((await osxCanRecordAudio() ==
|
||||
PermissionAuthorizeType.authorized)) {
|
||||
watchIsCanRecordAudio = false;
|
||||
setState(() {});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
watchIsCanRecordAudio = false;
|
||||
setState(() {});
|
||||
}
|
||||
}
|
||||
});
|
||||
Get.put<RxBool>(svcStopped, tag: 'stop-service');
|
||||
rustDeskWinManager.registerActiveWindowListener(onActiveWindowChanged);
|
||||
|
||||
Reference in New Issue
Block a user