import xdg-desktop-portal-1.6.0-4.el8

This commit is contained in:
CentOS Sources 2021-03-30 15:30:27 -04:00 committed by Stepan Oksanichenko
parent 12fdd87355
commit 78a8b880d2
2 changed files with 70 additions and 1 deletions

View File

@ -0,0 +1,53 @@
From 406a8849261e6301a66b7f1ece35051afd828592 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Sun, 6 Sep 2020 15:32:14 +0100
Subject: [PATCH] open-uri: Don't crash if there is no default or latest app
g_desktop_app_info_new() requires a non-NULL argument.
Partially addresses #524.
Fixes: 69205f12 "open-uri: Show app chooser when default app does not exist"
Signed-off-by: Simon McVittie <smcv@collabora.com>
---
src/open-uri.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/open-uri.c b/src/open-uri.c
index bb63478..f746e64 100644
--- a/src/open-uri.c
+++ b/src/open-uri.c
@@ -555,6 +555,8 @@ app_exists (const char *app_id)
{
g_autoptr(GDesktopAppInfo) info = NULL;
+ g_return_val_if_fail (app_id != NULL, FALSE);
+
info = g_desktop_app_info_new (app_id);
return (info != NULL);
}
@@ -667,13 +669,13 @@ handle_open_in_thread_func (GTask *task,
/* collect all the information */
find_recommended_choices (scheme, content_type, &default_app, &choices, &n_choices);
- if (!app_exists (default_app))
+ if (default_app != NULL && !app_exists (default_app))
g_clear_pointer (&default_app, g_free);
use_default_app = should_use_default_app (scheme, content_type);
get_latest_choice_info (app_id, content_type,
&latest_id, &latest_count, &latest_threshold,
&ask_for_content_type);
- if (!app_exists (latest_id))
+ if (latest_id != NULL && !app_exists (latest_id))
g_clear_pointer (&latest_id, g_free);
skip_app_chooser = FALSE;
@@ -729,7 +731,7 @@ handle_open_in_thread_func (GTask *task,
app = latest_id;
else if (default_app != NULL)
app = default_app;
- else if (choices && app_exists (choices[0]))
+ else if (n_choices > 0 && app_exists (choices[0]))
app = choices[0];
if (app)

View File

@ -3,7 +3,7 @@
Name: xdg-desktop-portal
Version: 1.6.0
Release: 1%{?dist}
Release: 4%{?dist}
Summary: Portal frontend service to flatpak
License: LGPLv2+
@ -22,6 +22,8 @@ Patch6: 0005-open-uri-avoid-criticals-when-app-to-open-does-not-e.patch
# Build against older glib2
Patch7: 0001-Don-t-use-g_strv_equals.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1886025
Patch8: xdg-desktop-portal-1.6.0-fix-openuri-crash.patch
BuildRequires: gcc
BuildRequires: pkgconfig(flatpak)
@ -44,6 +46,10 @@ Recommends: flatpak >= 1.2.0
Requires: geoclue2 >= %{geoclue_version}
Recommends: pipewire >= %{pipewire_version}
Requires: pipewire-libs >= %{pipewire_version}
# Until WebRTC supports PipeWire 0.3 we have to require PipeWire 0.2 to be
# preinstalled otherwise the screen and window sharing won't work in Chrome and
# Chromium out of the box.
Requires: pipewire0.2-libs%{?_isa}
# Required for the document portal.
Requires: /usr/bin/fusermount
@ -113,6 +119,16 @@ install -dm 755 %{buildroot}/%{_datadir}/%{name}/portals
%changelog
* Thu Feb 18 2021 Tomas Pelka <tpelka@redhat.com> - 1.6.0-4
- Bump version and rebuild due to z-stream release with the same version
* Fri Oct 09 2020 David King <dking@redhat.com> - 1.6.0-3
- Fix OpenURI crash (#1886025)
* Thu Jul 15 2020 Jonas Ådahl <jadahl@redhat.com> - 1.6.0-2
- Require pipewire0.2-libs for legacy application support.
Resolves: #1854734
* Mon May 25 2020 Jonas Ådahl <jadahl@redhat.com> - 1.6.0-1
- Rebase to 1.6.0 (#1775345)
- Backport PipeWire 0.3 support (#1775345)