aboutsummaryrefslogtreecommitdiff
path: root/kms/client/kms_client.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2023-11-29 21:40:24 +0100
committerdec05eba <dec05eba@protonmail.com>2023-11-29 21:40:24 +0100
commitf9e067b82874266c501bdeb847611cae0a28163d (patch)
tree3abf78bfa456594d916aff002c8573c5be2defe2 /kms/client/kms_client.c
parent31e8ba837ac3c9321f9415535113f049d69c661d (diff)
has perm should have higher priority than flatpak check
Diffstat (limited to 'kms/client/kms_client.c')
-rw-r--r--kms/client/kms_client.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/kms/client/kms_client.c b/kms/client/kms_client.c
index 737dfdd..75b1e8a 100644
--- a/kms/client/kms_client.c
+++ b/kms/client/kms_client.c
@@ -244,12 +244,12 @@ int gsr_kms_client_init(gsr_kms_client *self, const char *card_path) {
fprintf(stderr, "gsr error: gsr_kms_client_init: fork failed, error: %s\n", strerror(errno));
goto err;
} else if(pid == 0) { /* child */
- if(inside_flatpak) {
- const char *args[] = { "flatpak-spawn", "--host", "pkexec", "flatpak", "run", "--command=gsr-kms-server", "com.dec05eba.gpu_screen_recorder", self->initial_socket_path, card_path, NULL };
- execvp(args[0], (char *const*)args);
- } else if(has_perm) {
+ if(has_perm) {
const char *args[] = { server_filepath, self->initial_socket_path, card_path, NULL };
execvp(args[0], (char *const*)args);
+ } else if(inside_flatpak) {
+ const char *args[] = { "flatpak-spawn", "--host", "pkexec", "flatpak", "run", "--command=gsr-kms-server", "com.dec05eba.gpu_screen_recorder", self->initial_socket_path, card_path, NULL };
+ execvp(args[0], (char *const*)args);
} else {
const char *args[] = { "pkexec", server_filepath, self->initial_socket_path, card_path, NULL };
execvp(args[0], (char *const*)args);