From 4572d69932a11e157985c7c515d1e094b88707c6 Mon Sep 17 00:00:00 2001 From: koekeishiya Date: Sun, 4 Aug 2024 23:02:35 +0200 Subject: [PATCH] #2378 don't request screen capture permission when setting window_animation_duration to 0.0 --- src/message.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/message.c b/src/message.c index 421123f4..6f53d18e 100644 --- a/src/message.c +++ b/src/message.c @@ -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();