From 7b760f85f4d227e0a9699bb3cd81fc0128167db0 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Wed, 29 Dec 2021 18:40:34 -0800 Subject: [PATCH] image_view: Use window identifier for wallpaper portal Makes the dialog modal. --- src/widgets/image_view.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/widgets/image_view.rs b/src/widgets/image_view.rs index 58877fd..2f91174 100644 --- a/src/widgets/image_view.rs +++ b/src/widgets/image_view.rs @@ -272,8 +272,13 @@ impl LpImageView { let wallpaper = self.uri().context("No URI for current file")?; let ctx = glib::MainContext::default(); ctx.spawn_local(clone!(@weak self as view => async move { + let id = WindowIdentifier::from_native( + &view.native().expect("View should have a GtkNative"), + ) + .await; + let status = match wallpaper::set_from_uri( - &WindowIdentifier::default(), + &id, &wallpaper, true, wallpaper::SetOn::Background,