Skip to content

Conversation

tytan652
Copy link
Contributor

@tytan652 tytan652 commented Mar 16, 2025

I thought about how to improve Door Knocker like:

  • being able to fetch if the access portal is present which if missing cause some portal to be disabled
  • avoid relying on --talk-name=org.freedesktop.Flatpak and flatpak-spawn but add a --talk-name to a specific interface
  • potentially get backends in use and the portal version implemented

At the same time I tried to make sure that this interface is not meant only for my application but also could be used by desktop environment to have a good insight of the state of the portal service.

This interface is not meant to be accessible directly by Flatpak application.

@tytan652 tytan652 force-pushed the diagnotic_iface branch 2 times, most recently from 06cf532 to 95fdc07 Compare March 17, 2025 07:41
@swick
Copy link
Collaborator

swick commented Sep 3, 2025

I honestly do not understand the purpose of this, and what problem it tries to solve.

@tytan652
Copy link
Contributor Author

tytan652 commented Sep 3, 2025

I guess you never met a dozen of users with portal issue without any proper way to help them.

Because the whole point is to enable a way to know the state of xdp portals and create tools over it, even the DE itself right now can't know.

Why the camera portal is not there ?

Maybe it's because there is no access portal impl, there is no way to know for sure.

@swick
Copy link
Collaborator

swick commented Sep 3, 2025

Okay, so this is for diagnostics from the outside; kind of missed that. I guess that makes sense, but just having a dbus service by itself isn't that useful. If there was a tool that we can ship to users which prints some stuff, I would be in.

I'm also not entirely sure on the information that we would want to expose there, but I guess it's a good start.

@@ -74,6 +74,10 @@ background_monitor_sources = files(
'org.freedesktop.background.Monitor.xml',
)

diagnostic_portal_sources = files(
'org.freedesktop.diagnostic.portal.Desktop.xml',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We now have the org.freedesktop.host.portal namespace, might make sense to re-use that.

Comment on lines +51 to +52
Indicate if the version of the service is unstable.
Assume unstable if ``name``, ``version`` or ``stable`` is not present
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have unstable portals?

Copy link
Contributor Author

@tytan652 tytan652 Sep 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's xdp own version, not everyone is aware of "odd minor means unstable".

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see why this needs to be encoded in the API though; especially because versioning schemes can change.

Version of the implementation if the interface is versioned.
Assume 1 if not present
-->
<property name="lockdown-impl" type="a{sv}" access="read">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why there are a bunch of properties for specific impls instead of exposing a single property with all the impls?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Access and lockdown state affect various portals (and don't have non-impl counterpart).

One being missing will cause some portals to be missing.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm aware of how that works. This doesn't answer the question. Why only expose some of the impls and not all?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because those are excluded from the portals property, since it only list impls meant to specific portal.

Comment on lines +94 to +96
The list of portal with details about their state:

* ``name``` (``s``)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From looking at the signature we have a tuple where the first element is probably the name, and the second element is probably the vardict documented below. So ``name`` implies this is a vardict, but it's not, it's just a string.

Could just make this an array of vardicts with name as one possible property.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC, I made it this way so you can just check for the key to know if the portal has an impl and not loop to find it (even if internally it may loop anyway).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't seem very useful to me. Vardicts are also just arrays. Duplicating all the data here just seems unnecessary.


Each portal can contain the following properties:

* ``implementation`` (``a{sv}``)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could just provide the name of the impl and let the caller correlate that with the impl data from another property.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's made that way to avoid having to update the interface for every new portal, unless it's an impl like Access or Lockdown.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't have to add a new property for every impl. Just one property that enumerates all the impls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants