Skip to content

Commit

Permalink
#2378 don't request screen capture permission when setting window_ani…
Browse files Browse the repository at this point in the history
…mation_duration to 0.0
  • Loading branch information
koekeishiya committed Aug 4, 2024
1 parent 14f1220 commit 4572d69
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -1270,12 +1270,12 @@ 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;
} 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);
}
if (value.float_value == 0.0f) {
g_window_manager.window_animation_duration = value.float_value;
} else if (!scripting_addition_is_sip_friendly()) {
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 if (CGPreflightScreenCaptureAccess()) {
g_window_manager.window_animation_duration = value.float_value;
} 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();
Expand Down

0 comments on commit 4572d69

Please sign in to comment.