Cleanup secure keyboard entry logging
This commit is contained in:
parent
6cee6b6429
commit
f3c559ea13
@ -653,39 +653,39 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)update {
|
- (void)update {
|
||||||
debug_key("Update secure keyboard entry. desired=%d active=%d",
|
debug_key("Update secure keyboard entry. desired=%d active=%d\n",
|
||||||
(int)self.isDesired, (int)[NSApp isActive]);
|
(int)self.isDesired, (int)[NSApp isActive]);
|
||||||
const BOOL secure = self.isDesired && [self allowed];
|
const BOOL secure = self.isDesired && [self allowed];
|
||||||
|
|
||||||
if (secure && _count > 0) {
|
if (secure && _count > 0) {
|
||||||
debug_key("Want to turn on secure input but it's already on");
|
debug_key("Want to turn on secure input but it's already on\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!secure && _count == 0) {
|
if (!secure && _count == 0) {
|
||||||
debug_key("Want to turn off secure input but it's already off");
|
debug_key("Want to turn off secure input but it's already off\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
debug_key("Before: IsSecureEventInputEnabled returns %d", (int)self.isEnabled);
|
debug_key("Before: IsSecureEventInputEnabled returns %d ", (int)self.isEnabled);
|
||||||
if (secure) {
|
if (secure) {
|
||||||
OSErr err = EnableSecureEventInput();
|
OSErr err = EnableSecureEventInput();
|
||||||
debug_key("EnableSecureEventInput err=%d", (int)err);
|
debug_key("EnableSecureEventInput err=%d ", (int)err);
|
||||||
if (err) {
|
if (err) {
|
||||||
debug_key("EnableSecureEventInput failed with error %d", (int)err);
|
debug_key("EnableSecureEventInput failed with error %d ", (int)err);
|
||||||
} else {
|
} else {
|
||||||
_count += 1;
|
_count += 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
OSErr err = DisableSecureEventInput();
|
OSErr err = DisableSecureEventInput();
|
||||||
debug_key("DisableSecureEventInput err=%d", (int)err);
|
debug_key("DisableSecureEventInput err=%d ", (int)err);
|
||||||
if (err) {
|
if (err) {
|
||||||
debug_key("DisableSecureEventInput failed with error %d", (int)err);
|
debug_key("DisableSecureEventInput failed with error %d ", (int)err);
|
||||||
} else {
|
} else {
|
||||||
_count -= 1;
|
_count -= 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
debug_key("After: IsSecureEventInputEnabled returns %d", (int)self.isEnabled);
|
debug_key("After: IsSecureEventInputEnabled returns %d\n", (int)self.isEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user