-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
USB Portal #210
base: master
Are you sure you want to change the base?
USB Portal #210
Conversation
fced97d
to
ecb8189
Compare
Currently includes a revert for #208 |
4d81103
to
de86287
Compare
The build failure is because it needs a flatpak version that isn't available. |
239d19c
to
1f7eec3
Compare
#[strong] | ||
page, | ||
async move { | ||
let usb = UsbProxy::new().await.unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep the proxy around
|
||
pub(super) async fn stop_session(&self) -> anyhow::Result<()> { | ||
if let Some(session) = self.session.lock().await.take() { | ||
session.close().await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should switch the buttons state
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is done by the non-imp version which is the one called from the UI.
3aee673
to
9146631
Compare
7eadba8
to
7697720
Compare
Signed-off-by: Hubert Figuière <[email protected]>
This allow running the release build. Signed-off-by: Hubert Figuière <[email protected]>
@@ -13,6 +13,8 @@ | |||
"--share=ipc", | |||
"--socket=wayland", | |||
"--device=dri", | |||
"--own-name=com.belmoussaoui.ashpd.demo", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this needed? Isn't this only to own names for app ids which don't match the app id?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use this build using fenv
, and that allow to build and run the non "Devel" version. It's not required for this PR per see (hint it's still in draft).
<property name="margin-top">6</property> | ||
<property name="margin-bottom">6</property> | ||
<style> | ||
<class name="linked" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In think the consensus is that we want to avoid linked buttons whenever possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
link (to the documentation) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is none, ask in the #design:gnome.org room if you would like more context.
src/desktop/usb.rs
Outdated
pub struct UsbDevice { | ||
parent: Option<String>, | ||
readable: Option<bool>, | ||
/// Device is writable. Default is false. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an option, please document None
. Ditto for readable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Default is false". I thought this was clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
documented readable
. (cf the D-Bus xml)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does None
mean? How is it different from false
? Why would you get one over the other?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because it's the a{sv}
from D-Bus. As per the D-Bus interface it can be omitted so it has to be omittable here.
85d3611
to
15d92c9
Compare
@@ -50,14 +62,15 @@ | |||
{ | |||
"name": "ashpd-demo", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I rather have a change that puts the manifest in ./ and see if that helps? :)
#[zvariant(signature = "dict")] | ||
struct AcquiredDevice { | ||
success: bool, | ||
fd: Option<OwnedFd>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if success = true, do we always receive an fd or not? or if the success = true and fd = None, there are no more fds to acquire?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If success is true we expect the fd, otherwise the error is set.
This doesn't preclude other devices to be successfully acquired.
src/desktop/usb.rs
Outdated
} | ||
|
||
/// Device to acquire | ||
pub struct Device(pub String /* ID */, pub bool /* writable */); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a constructor/getters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the getters have been added but aren't used. Maybe I should just omit them as the struct is only constructed (added a new
)
Signed-off-by: Hubert Figuière <[email protected]>
- Added UI for USB - Added rusb to the crates. - Added libusb to the manifest. Signed-off-by: Hubert Figuière <[email protected]>
This is a draft, needs a lot of cleanup. Also the portal hasn't landed yet.
But I'm using this to exercise / test the USB portal.