aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2025-05-10 21:51:14 +0200
committerdec05eba <dec05eba@protonmail.com>2025-05-10 21:51:14 +0200
commit085d4632d26d09070c3e80a2fc03fd283b9d3e19 (patch)
treebd9ec525c41fb6a4c6436cc5042201bd3bac7271
parent39503de742c699a9a3f76c65697e199845045f66 (diff)
Show warning for missing capability
-rw-r--r--dbus/client/dbus_client.h2
-rw-r--r--src/egl.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/dbus/client/dbus_client.h b/dbus/client/dbus_client.h
index c9e8182..98a1ecf 100644
--- a/dbus/client/dbus_client.h
+++ b/dbus/client/dbus_client.h
@@ -2,7 +2,7 @@
#define GSR_DBUS_CLIENT_H
/*
- Using a client-server architecture is needed for dbus because cap_sys_nice doesn't work with desktop portal.
+ Using a client-server architecture is needed for dbus because cap_sys_nice breaks desktop portal.
The main binary has cap_sys_nice and we launch a new child-process without it which uses uses desktop portal.
*/
diff --git a/src/egl.c b/src/egl.c
index 8e38589..dd84325 100644
--- a/src/egl.c
+++ b/src/egl.c
@@ -39,6 +39,12 @@ static void reset_cap_nice(void) {
if(!caps)
return;
+ cap_flag_value_t cap_sys_nice_value = CAP_CLEAR;
+ cap_get_flag(caps, CAP_SYS_NICE, CAP_EFFECTIVE, &cap_sys_nice_value);
+ if(cap_sys_nice_value == CAP_CLEAR) {
+ fprintf(stderr, "gsr warning: cap_sys_nice capability is missing on the gpu-screen-recorder binary, performance might be affected. If you are using the flatpak version of gpu-screen-recorder then the only fix is to use a non-flatpak version of gpu-screen-recorder\n");
+ }
+
const cap_value_t cap_to_remove = CAP_SYS_NICE;
cap_set_flag(caps, CAP_EFFECTIVE, 1, &cap_to_remove, CAP_CLEAR);
cap_set_flag(caps, CAP_PERMITTED, 1, &cap_to_remove, CAP_CLEAR);