gsm_manager_inhibit() requires a non-empty Application ID, making it impossible to use Inhibit xdg portal
GSM doesn't accept inhibition requests by applications that do not specify an application ID (see gsm-manager.c
).
This choice clashes with xdg-desktop-portal's interface because if the client is an host application, the portal passes to xdg-desktop-portal-gtk an empty string as app_id
because "it could be lying" (see this issue).
I don't really know why upstream wants to keep this security measure for un-sendboxed applications as well.
STEPS TO REPRODUCE
- run
/lib/xdg-desktop-portal-gtk --replace --verbose
- run my quick demo: https://gist.github.com/carlocastoldi/b52a3434c36b8bf185afe4a545ff90d8
- click on the GUI bottom once for inhibiting
** (xdg-desktop-portal-gtk:241666): WARNING **: 01:10:24.323: Backend call failed: GDBus.Error:org.gnome.SessionManager.GeneralError: Application ID not specified
Solution
Before going forward with proposing a solution upstream (to xdg-desktop-portal or xdg-desktop-portal-gtk) I'd like to know your opinion and how we can approach it.
The first & simplest idea that came to my mind was to test in org.freedesktop.impl.portal.Inhibit
if app_id
is empty and, if it is, apply the same rule as gnome-session-inhibit