From 89eda8854dacd1db6a2f16743dd68f3fa2eb69d9 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Fri, 6 Oct 2023 15:55:38 +0200 Subject: [PATCH] Backport upstream MR !168 to fix portal requests Shell rejects portal requests that come in before the window is mapped. --- 168.patch | 41 +++++++++++++++++++++++++++++++++++++++++ snapshot.spec | 3 +++ 2 files changed, 44 insertions(+) create mode 100644 168.patch diff --git a/168.patch b/168.patch new file mode 100644 index 0000000..a61df29 --- /dev/null +++ b/168.patch @@ -0,0 +1,41 @@ +From 58f4e29679e25a031133bfc145ae7a3f034efd9c Mon Sep 17 00:00:00 2001 +From: Maximiliano Sandoval R +Date: Thu, 5 Oct 2023 22:01:36 +0200 +Subject: [PATCH] window: Ask portal only once the window is mapped + +Otherwise the shell will reject the permission. +--- + src/widgets/window.rs | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/src/widgets/window.rs b/src/widgets/window.rs +index 8ec35fc3..397da532 100644 +--- a/src/widgets/window.rs ++++ b/src/widgets/window.rs +@@ -165,15 +165,20 @@ mod imp { + let enabled = navigation_view.visible_page().is_some_and(|page| &page == &*imp.camera_page); + obj.set_shutter_enabled(enabled); + })); ++ } ++ } + ++ impl WidgetImpl for Window { ++ fn map(&self) { ++ self.parent_map(); ++ let camera = self.camera.get(); + let ctx = glib::MainContext::default(); +- ctx.spawn_local(glib::clone!(@weak obj => async move { +- obj.imp().camera.start().await; ++ ctx.spawn_local(glib::clone!(@weak camera => async move { ++ camera.start().await; + })); + } + } + +- impl WidgetImpl for Window {} + impl WindowImpl for Window { + // Save window state on delete event + fn close_request(&self) -> glib::Propagation { +-- +GitLab + diff --git a/snapshot.spec b/snapshot.spec index 59a25dc..82b7919 100644 --- a/snapshot.spec +++ b/snapshot.spec @@ -34,6 +34,9 @@ Source: https://download.gnome.org/sources/snapshot/45/snapshot-%{tarbal # Downstream patch to disable linting as part of self tests Patch: 0001-Disable-cargo-clippy-test.patch +# https://gitlab.gnome.org/GNOME/snapshot/-/merge_requests/168 +Patch: 168.patch + # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval ExcludeArch: %{ix86}