mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-26 01:27:42 +00:00
feat(mac): register observers before privacy dialog
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
also uncomment sentry tag for accessibility state
This commit is contained in:
parent
f0ce1c6aa1
commit
34b5c8cbdc
1 changed files with 13 additions and 6 deletions
|
|
@ -82,7 +82,9 @@ id _lastServerWithOSKShowing = nil;
|
|||
|
||||
- (id)init {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
if (self) {
|
||||
[self registerObservers];
|
||||
|
||||
// first notify user and request access to Accessibility/PostEvent permissions
|
||||
// pass block as completion handler to complete init with initCompletion
|
||||
[PrivacyConsent.shared requestPrivacyAccess:^void (void){
|
||||
|
|
@ -125,7 +127,15 @@ id _lastServerWithOSKShowing = nil;
|
|||
if (self.runLoopEventSrc && runLoop) {
|
||||
CFRunLoopAddSource(runLoop, self.runLoopEventSrc, kCFRunLoopDefaultMode);
|
||||
}
|
||||
|
||||
|
||||
// start Input Method lifecycle
|
||||
[KMInputMethodLifecycle.shared startLifecycle];
|
||||
}
|
||||
|
||||
/**
|
||||
* Register observers for local and distributed notifications
|
||||
*/
|
||||
- (void)registerObservers {
|
||||
// register to receive notifications generated from KMInputMethodLifecycle
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(inputMethodActivated:) name:kInputMethodActivatedNotification object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(inputMethodDeactivated:) name:kInputMethodDeactivatedNotification object:nil];
|
||||
|
|
@ -135,9 +145,6 @@ id _lastServerWithOSKShowing = nil;
|
|||
[[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(handleKeyboardsChanged:) name:kKeyboardsChanged object:nil];
|
||||
[[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(handleAccessibilityCheckRequested:) name:kAccessibilityCheckedRequest object:nil];
|
||||
[[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(handleAccessibilityRequested:) name:kAccessibilityRequest object:nil];
|
||||
|
||||
// start Input Method lifecycle
|
||||
[KMInputMethodLifecycle.shared startLifecycle];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -296,7 +303,7 @@ id _lastServerWithOSKShowing = nil;
|
|||
|
||||
// assign custom keyboard tags in Sentry
|
||||
[KMSentryHelper addKeyboardTag:keyboardFileName];
|
||||
// [KMSentryHelper addHasAccessibilityTag:[PrivacyConsent.shared checkAccessibility]];
|
||||
[KMSentryHelper addHasAccessibilityTag:[PrivacyConsent.shared checkAccessibility]];
|
||||
[KMSentryHelper addOskVisibleTag:[self.oskWindow.window isVisible]];
|
||||
[KMSentryHelper addArchitectureTag:processorType];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue