Skip to content

Commit

Permalink
Request perms only when window animation enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Pick committed Aug 4, 2024
1 parent d9dcbc2 commit 70a9c24
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -1270,15 +1270,17 @@ static void handle_domain_config(FILE *rsp, struct token domain, char *message)
if (value.type == TOKEN_TYPE_INVALID) {
fprintf(rsp, "%f\n", g_window_manager.window_animation_duration);
} else if (value.type == TOKEN_TYPE_FLOAT) {
if (CGPreflightScreenCaptureAccess()) {
if (scripting_addition_is_sip_friendly()) {
g_window_manager.window_animation_duration = value.float_value;
if (value.float_value) {
if (CGPreflightScreenCaptureAccess()) {
if (scripting_addition_is_sip_friendly()) {
g_window_manager.window_animation_duration = value.float_value;
} else {
daemon_fail(rsp, "command '%.*s' for domain '%.*s' requires System Integrity Protection to be partially disabled! ignoring request..\n", command.length, command.text, domain.length, domain.text);
}
} else {
daemon_fail(rsp, "command '%.*s' for domain '%.*s' requires System Integrity Protection to be partially disabled! ignoring request..\n", command.length, command.text, domain.length, domain.text);
daemon_fail(rsp, "command '%.*s' for domain '%.*s' requires Screen Recording permissions! ignoring request..\n", command.length, command.text, domain.length, domain.text);
CGRequestScreenCaptureAccess();
}
} else {
daemon_fail(rsp, "command '%.*s' for domain '%.*s' requires Screen Recording permissions! ignoring request..\n", command.length, command.text, domain.length, domain.text);
CGRequestScreenCaptureAccess();
}
} else {
daemon_fail(rsp, "unknown value '%.*s' given to command '%.*s' for domain '%.*s'\n", value.token.length, value.token.text, command.length, command.text, domain.length, domain.text);
Expand Down

0 comments on commit 70a9c24

Please sign in to comment.