Skip to content

Commit

Permalink
chore: impl access for new xdg-desktop-portal
Browse files Browse the repository at this point in the history
  • Loading branch information
Decodetalkers committed Oct 5, 2023
1 parent 272eed9 commit f8e6504
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
3 changes: 1 addition & 2 deletions misc/luminous.portal
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[portal]
DBusName=org.freedesktop.impl.portal.desktop.luminous
Interfaces=org.freedesktop.impl.portal.Screenshot;org.freedesktop.impl.portal.ScreenCast;org.freedesktop.impl.portal.RemoteDesktop;org.freedesktop.impl.portal.Settings;
UseIn=wlroots;sway;Wayfire;river;phosh;Hyprland,nextwm;
Interfaces=org.freedesktop.impl.portal.Screenshot;org.freedesktop.impl.portal.ScreenCast;org.freedesktop.impl.portal.RemoteDesktop;org.freedesktop.impl.portal.Settings;org.freedesktop.impl.portal.Access;
27 changes: 27 additions & 0 deletions src/access.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
use std::collections::HashMap;

use zbus::{
dbus_interface, fdo,
zvariant::{OwnedValue, Value},
};

use crate::PortalResponse;

#[derive(Debug)]
pub struct AccessBackend;

#[dbus_interface(name = "org.freedesktop.impl.portal.Access")]
impl AccessBackend {
async fn access_dialog(
&self,
_app_id: String,
_parrent_window: String,
_title: String,
_sub_title: String,
_body: String,
_options: HashMap<String, Value<'_>>,
) -> fdo::Result<PortalResponse<HashMap<String, OwnedValue>>> {
Ok(PortalResponse::Success(HashMap::new()))
}
// add code here
}
3 changes: 3 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
mod access;
mod remotedesktop;
mod request;
mod screencast;
Expand All @@ -6,6 +7,7 @@ mod session;
mod settings;
mod slintbackend;

use access::AccessBackend;
use remotedesktop::RemoteDesktopBackend;
use screencast::ScreenCastBackend;
use screenshot::ScreenShotBackend;
Expand Down Expand Up @@ -118,6 +120,7 @@ async fn main() -> anyhow::Result<()> {

let conn = ConnectionBuilder::session()?
.name("org.freedesktop.impl.portal.desktop.luminous")?
.serve_at("/org/freedesktop/portal/desktop", AccessBackend)?
.serve_at("/org/freedesktop/portal/desktop", ScreenShotBackend)?
.serve_at("/org/freedesktop/portal/desktop", ScreenCastBackend)?
.serve_at("/org/freedesktop/portal/desktop", RemoteDesktopBackend)?
Expand Down

0 comments on commit f8e6504

Please sign in to comment.