Skip to content

Commit 45b5f7a

Browse files
gruljajadahl
authored andcommitted
Camera: use an empty app id for host apps
Sending an app id that doesn't resolve to valid app info (e.g. a desktop file is not found) will automatically reject camera request, because the backend is not able to verify whether the app (based on app id) runs in the background. Same will happen if the app id resolves to an app where our app was started from. This happens for example when you start apps in GNOME using Alt + F2, where we get invalid app id from cgroups and since it doesn't find opened application window for this app, it will automatically reject the request. Using an empty id fixes this problem. (cherry picked from commit 6cd99b0)
1 parent c80cb5c commit 45b5f7a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/camera.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ handle_access_camera_in_thread_func (GTask *task,
7676
const char *app_id;
7777
gboolean allowed;
7878

79-
app_id = (const char *)g_object_get_data (G_OBJECT (request), "app-id");
79+
if (xdp_app_info_is_host (request->app_info))
80+
app_id = "";
81+
else
82+
app_id = (const char *)g_object_get_data (G_OBJECT (request), "app-id");
8083

8184
allowed = device_query_permission_sync (app_id, "camera", request);
8285

0 commit comments

Comments
 (0)