Add support for USB portal#25
Conversation
Signed-off-by: Felicitas Pojtinger <felicitas@pojtinger.com>
Signed-off-by: Felicitas Pojtinger <felicitas@pojtinger.com>
…s` for the USB portal Signed-off-by: Felicitas Pojtinger <felicitas@pojtinger.com>
Signed-off-by: Felicitas Pojtinger <felicitas@pojtinger.com>
Signed-off-by: Felicitas Pojtinger <felicitas@pojtinger.com>
Signed-off-by: Felicitas Pojtinger <felicitas@pojtinger.com>
Signed-off-by: Felicitas Pojtinger <felicitas@pojtinger.com>
Signed-off-by: Felicitas Pojtinger <felicitas@pojtinger.com>
Signed-off-by: Felicitas Pojtinger <felicitas@pojtinger.com>
Signed-off-by: Felicitas Pojtinger <felicitas@pojtinger.com>
Signed-off-by: Felicitas Pojtinger <felicitas@pojtinger.com>
|
Sorry about the CI failures there - I was testing on Go 1.26 earlier locally. Should be all ready now. |
Jacalz
left a comment
There was a problem hiding this comment.
Thanks for this, I appreciate it very much. Haven't tested it locally yet but I added some notes inline :)
| @@ -0,0 +1,132 @@ | |||
| package main | |||
There was a problem hiding this comment.
Maybe this cmd command can be made into an example for the API docs in the usb package instead? I don't know exactly how Go handles that but I think you kind of make a test.
I've had some ideas about creating an app to test out the portals but never got around to it.
There was a problem hiding this comment.
re:portal test app - yup, I was thinking of a similar thing. A CLI might be a tad more maintainable I'm thinking? Optimally there would be an OpenQA test suite against the portal spec using something like GNOME's implementation of the portals, but I digress
Good idea re:examples, never actually used that Go feature. Looks like this now in go doc:
Resolved via bd77c97
| } | ||
|
|
||
| // UnixFDToUintptr is a fast converter from a dbus UnixFD to a uintptr. | ||
| func UnixFDToUintptr(input dbus.UnixFD) (uintptr, error) { |
There was a problem hiding this comment.
This seems to be a copy of a similar function I added very recently on main. I think you want to remove this commit and rebase on main.
There was a problem hiding this comment.
Oh yes, I did copy it, but mine is the other way around compared to main! It's a helper to get it converted the other way. See d00323e
Signed-off-by: Felicitas Pojtinger <felicitas@pojtinger.com>
Description:
This implements the USB portal (https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.Usb.html). I'm planning on using this - or better, a potential future serial port terminal - in https://codeberg.org/pojntfx/runway.
Adds all the methods and signals. Skipped the
versionproperty since no other portal in this repo implements it.I've also added a little CLI,
cmd/usb, to test it. The portal is really new, I could find no apps using it yet aside from my own experiments (given thatlibportaldoesn't support it yet), so this was kind of necessary during testing. Feel free to remove it if it shouldn't be part of this repo (no other portals have something like it, so I'd understand).Checklist:
usbcommand