config_input not well tested yet
This commit is contained in:
parent
ce5b49b7dd
commit
584295f3fa
@ -42,6 +42,7 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
|||||||
var svcStopped = false.obs;
|
var svcStopped = false.obs;
|
||||||
var watchIsCanScreenRecording = false;
|
var watchIsCanScreenRecording = false;
|
||||||
var watchIsProcessTrust = false;
|
var watchIsProcessTrust = false;
|
||||||
|
var watchIsInputMonitoring = false;
|
||||||
Timer? _updateTimer;
|
Timer? _updateTimer;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -334,6 +335,12 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
|||||||
bind.mainIsProcessTrusted(prompt: true);
|
bind.mainIsProcessTrusted(prompt: true);
|
||||||
watchIsProcessTrust = true;
|
watchIsProcessTrust = true;
|
||||||
}, help: 'Help', link: translate("doc_mac_permission"));
|
}, help: 'Help', link: translate("doc_mac_permission"));
|
||||||
|
} else if (!bind.mainIsCanInputMonitoring(prompt: false)) {
|
||||||
|
return buildInstallCard("Permissions", "config_input", "Configure",
|
||||||
|
() async {
|
||||||
|
bind.mainIsCanInputMonitoring(prompt: true);
|
||||||
|
watchIsInputMonitoring = true;
|
||||||
|
}, help: 'Help', link: translate("doc_mac_permission"));
|
||||||
} else if (!svcStopped.value &&
|
} else if (!svcStopped.value &&
|
||||||
bind.mainIsInstalled() &&
|
bind.mainIsInstalled() &&
|
||||||
!bind.mainIsInstalledDaemon(prompt: false)) {
|
!bind.mainIsInstalledDaemon(prompt: false)) {
|
||||||
@ -467,6 +474,12 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
|||||||
setState(() {});
|
setState(() {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (watchIsInputMonitoring) {
|
||||||
|
if (bind.mainIsCanInputMonitoring(prompt: false)) {
|
||||||
|
watchIsInputMonitoring = false;
|
||||||
|
setState(() {});
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
Get.put<RxBool>(svcStopped, tag: 'stop-service');
|
Get.put<RxBool>(svcStopped, tag: 'stop-service');
|
||||||
rustDeskWinManager.registerActiveWindowListener(onActiveWindowChanged);
|
rustDeskWinManager.registerActiveWindowListener(onActiveWindowChanged);
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
extern "C" bool InputMonitoringAuthStatus(bool prompt) {
|
extern "C" bool InputMonitoringAuthStatus(bool prompt) {
|
||||||
if (@available(macos 10.15, *)) {
|
if (@available(macos 10.15, *)) {
|
||||||
IOHIDAccessType theType = IOHIDCheckAccess(kIOHIDRequestTypeListenEvent);
|
IOHIDAccessType theType = IOHIDCheckAccess(kIOHIDRequestTypeListenEvent);
|
||||||
NSLog(@"IOHIDCheckAccess = %d", theType);
|
NSLog(@"IOHIDCheckAccess = %d, kIOHIDAccessTypeGranted = %d", theType, kIOHIDAccessTypeGranted);
|
||||||
switch (theType) {
|
switch (theType) {
|
||||||
case kIOHIDAccessTypeGranted:
|
case kIOHIDAccessTypeGranted:
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user