Skip to content

Commit

Permalink
TMP 2
Browse files Browse the repository at this point in the history
Do not commit
  • Loading branch information
A6GibKm committed Jun 5, 2022
1 parent 03888c4 commit dfd187b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ashpd-demo/src/portals/desktop/open_uri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl OpenUriPage {
let identifier = WindowIdentifier::from_native(&root).await;
let uri = imp.uri_entry.text();
let activation_token = if imp.activation_token_switch.is_active() {
ashpd::ActivationToken::from_native(&root)
Some(ashpd::ActivationToken::from_native(&root).unwrap())
} else {
None
};
Expand Down
2 changes: 1 addition & 1 deletion src/activation_token/gtk4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl Gtk4ActivationToken {
};
let wl_surface = WlSurface::from_id(&cnx, surface_id).unwrap();

let wl = WaylandActivationToken::from_surface(&wl_surface).ok()?;
let wl = WaylandActivationToken::from_surface(&wl_surface).unwrap();

Some(Self::from(wl))
}
Expand Down
8 changes: 4 additions & 4 deletions src/activation_token/wayland.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ impl Drop for WaylandActivationToken {

impl WaylandActivationToken {
pub fn from_surface(surface: &WlSurface) -> Result<Self, Box<dyn std::error::Error>> {
let cnx = wayland_client::Connection::connect_to_env()?;
let wl_activation = XdgActivationV1::from_id(&cnx, surface.id())?;
let cnx = wayland_client::Connection::connect_to_env().unwrap();
let wl_activation = XdgActivationV1::from_id(&cnx, surface.id()).unwrap();
let mut queue = cnx.new_event_queue();
let queue_handle = queue.handle();
let inner = wl_activation.get_activation_token(&queue_handle, ())?;
let inner = wl_activation.get_activation_token(&queue_handle, ()).unwrap();
let mut exported_token = ExportedActivationToken::default();
queue.blocking_dispatch(&mut exported_token)?;
queue.blocking_dispatch(&mut exported_token).unwrap();

Ok(Self {
token: exported_token.0,
Expand Down

0 comments on commit dfd187b

Please sign in to comment.