Auto sync2gitlab import of xdg-desktop-portal-gtk-1.6.0-1.el8.src.rpm

This commit is contained in:
James Antill 2022-05-26 16:17:26 -04:00
parent eb9511de58
commit 77ffc98fc1
9 changed files with 376 additions and 1 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/xdg-desktop-portal-gtk-1.6.0.tar.xz

View File

@ -0,0 +1,38 @@
From 54ceb35d892ac33c59f4d255359d8184f1b72679 Mon Sep 17 00:00:00 2001
From: Michael Catanzaro <mcatanzaro@gnome.org>
Date: Fri, 1 May 2020 17:58:35 -0500
Subject: [PATCH 1/4] appchooserdialog: avoid crash when there are few app
options
Problem is the code reads off the end of the choices list when the
number of choices is less than INITIAL_LIST_SIZE - 1.
Fixes #302
(cherry picked from commit 7d2b3e270b6a964d8007b5cbb5dfc52c3f9a23ce)
---
src/appchooserdialog.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/appchooserdialog.c b/src/appchooserdialog.c
index 82e362e..0b9f31e 100644
--- a/src/appchooserdialog.c
+++ b/src/appchooserdialog.c
@@ -384,11 +384,11 @@ app_chooser_dialog_new (const char **choices,
gtk_label_set_label (GTK_LABEL (dialog->heading), _("Choose an application."));
}
- ensure_default_is_below (choices, default_id, INITIAL_LIST_SIZE - 1);
-
dialog->choices = g_strdupv ((char **)choices);
-
n_choices = g_strv_length ((char **)choices);
+
+ ensure_default_is_below (dialog->choices, default_id, MIN (n_choices, INITIAL_LIST_SIZE - 1));
+
if (n_choices == 0)
{
gtk_widget_show (dialog->empty_box);
--
2.26.2

View File

@ -0,0 +1,46 @@
From 4a280729ba87343d056360ed0be99e9e53ab44e9 Mon Sep 17 00:00:00 2001
From: Georges Basile Stavracas Neto
<GeorgesStavracas@users.noreply.github.com>
Date: Mon, 24 Feb 2020 17:20:19 -0300
Subject: [PATCH] screencast: Bump supported Mutter version to 3 (#280)
With the new Mutter version and the inclusion of pipewire 0.3 support
into Mutter, the reported D-Bus version for the screencast API was
bumped to 3.
Update the supported version here as well. No code changes are necessary
to make it work with the version 3 of the API.
---
src/gnomescreencast.c | 2 +-
src/screencast.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/gnomescreencast.c b/src/gnomescreencast.c
index 3ae5031..0df0f05 100644
--- a/src/gnomescreencast.c
+++ b/src/gnomescreencast.c
@@ -22,7 +22,7 @@
#include <stdint.h>
-#define SUPPORTED_MUTTER_SCREEN_CAST_API_VERSION 2
+#define SUPPORTED_MUTTER_SCREEN_CAST_API_VERSION 3
enum
{
diff --git a/src/screencast.c b/src/screencast.c
index 5418c23..c4c75a0 100644
--- a/src/screencast.c
+++ b/src/screencast.c
@@ -35,7 +35,7 @@
#include "session.h"
#include "utils.h"
-#define SUPPORTED_MUTTER_SCREEN_CAST_API_VERSION 2
+#define SUPPORTED_MUTTER_SCREEN_CAST_API_VERSION 3
typedef struct _ScreenCastDialogHandle ScreenCastDialogHandle;
--
2.26.2

View File

@ -0,0 +1,61 @@
From 86bd1b0055d32b8356011cde82b51296b9880588 Mon Sep 17 00:00:00 2001
From: Michael Catanzaro <mcatanzaro@gnome.org>
Date: Wed, 6 May 2020 10:43:13 -0500
Subject: [PATCH 2/4] appchooserdialog: improve handling of INITIAL_LIST_SIZE
Currently INITIAL_LIST_SIZE is one greater than the initial number of
desktop files presented, which is actually 3. I guess the "show more"
button is considered part of the initial list, in which case the size of
the list is indeed 4, but that's *really* confusing. Let's change this
so that it matches the number of desktop files presented initially. No
behavior changes.
(cherry picked from commit 15c6cd88b1ba2f913bc00eb46a04b045e77349ad)
---
src/appchooserdialog.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/appchooserdialog.c b/src/appchooserdialog.c
index 0b9f31e..b779f43 100644
--- a/src/appchooserdialog.c
+++ b/src/appchooserdialog.c
@@ -32,7 +32,7 @@
#include "appchooserrow.h"
#define LOCATION_MAX_LENGTH 40
-#define INITIAL_LIST_SIZE 4
+#define INITIAL_LIST_SIZE 3
struct _AppChooserDialog {
GtkWindow parent;
@@ -132,7 +132,7 @@ show_more (AppChooserDialog *dialog)
gtk_window_set_resizable (GTK_WINDOW (dialog), TRUE);
gtk_widget_hide (dialog->more_row);
- for (i = INITIAL_LIST_SIZE - 1; dialog->choices[i]; i++)
+ for (i = INITIAL_LIST_SIZE; dialog->choices[i]; i++)
{
g_autofree char *desktop_id = g_strconcat (dialog->choices[i], ".desktop", NULL);
g_autoptr(GAppInfo) info = G_APP_INFO (g_desktop_app_info_new (desktop_id));
@@ -387,7 +387,7 @@ app_chooser_dialog_new (const char **choices,
dialog->choices = g_strdupv ((char **)choices);
n_choices = g_strv_length ((char **)choices);
- ensure_default_is_below (dialog->choices, default_id, MIN (n_choices, INITIAL_LIST_SIZE - 1));
+ ensure_default_is_below (dialog->choices, default_id, MIN (n_choices, INITIAL_LIST_SIZE));
if (n_choices == 0)
{
@@ -416,9 +416,6 @@ app_chooser_dialog_new (const char **choices,
g_autoptr(GAppInfo) info = G_APP_INFO (g_desktop_app_info_new (desktop_id));
GtkWidget *row;
- if (i == INITIAL_LIST_SIZE - 1 && n_choices > INITIAL_LIST_SIZE)
- break;
-
row = GTK_WIDGET (app_chooser_row_new (info));
gtk_widget_set_visible (row, TRUE);
gtk_list_box_insert (GTK_LIST_BOX (dialog->list), row, -1);
--
2.26.2

View File

@ -0,0 +1,31 @@
From 34db1404382cebbfbf170cfba53371d465c1668f Mon Sep 17 00:00:00 2001
From: Michael Catanzaro <mcatanzaro@gnome.org>
Date: Wed, 6 May 2020 10:57:29 -0500
Subject: [PATCH 3/4] appchooserdialog: add g_return to show_more()
We should never get here unless there are more desktop file choices than
the initial list size. We never do; this assertion is just here to
clarify this. (Otherwise, we could have a buffer overrun in the loop
below.)
(cherry picked from commit 878c06a525b05315fe56baae59c19bfd714df638)
---
src/appchooserdialog.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/appchooserdialog.c b/src/appchooserdialog.c
index b779f43..c0eb4ca 100644
--- a/src/appchooserdialog.c
+++ b/src/appchooserdialog.c
@@ -132,6 +132,8 @@ show_more (AppChooserDialog *dialog)
gtk_window_set_resizable (GTK_WINDOW (dialog), TRUE);
gtk_widget_hide (dialog->more_row);
+ g_return_if_fail (g_strv_length ((char **)dialog->choices) > INITIAL_LIST_SIZE);
+
for (i = INITIAL_LIST_SIZE; dialog->choices[i]; i++)
{
g_autofree char *desktop_id = g_strconcat (dialog->choices[i], ".desktop", NULL);
--
2.26.2

View File

@ -0,0 +1,69 @@
From 8f01a166ec2097f913f4e69379954a96a38d0d84 Mon Sep 17 00:00:00 2001
From: Michael Catanzaro <mcatanzaro@gnome.org>
Date: Wed, 6 May 2020 10:57:41 -0500
Subject: [PATCH 4/4] appchooserdialog: improve safety of ensure_default
function
We can calculate the bounds ourselves, instead of passing them in. This
way we don't need to rely on the caller to avoid buffer overflow. This
would have prevented #302.
(cherry picked from commit 1f30f6c730cef5152e09ded897ec0d6e54e87820)
---
src/appchooserdialog.c | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/src/appchooserdialog.c b/src/appchooserdialog.c
index c0eb4ca..eb7181a 100644
--- a/src/appchooserdialog.c
+++ b/src/appchooserdialog.c
@@ -316,22 +316,26 @@ shorten_location (const char *location)
}
static void
-ensure_default_is_below (const char **choices,
- const char *default_id,
- int num)
+ensure_default_in_initial_list (const char **choices,
+ const char *default_id)
{
int i;
+ guint n_choices;
if (default_id == NULL)
return;
- for (i = 0; i < num && choices[i]; i++)
+ n_choices = g_strv_length ((char **)choices);
+ if (n_choices <= INITIAL_LIST_SIZE)
+ return;
+
+ for (i = 0; i < INITIAL_LIST_SIZE; i++)
{
if (strcmp (choices[i], default_id) == 0)
return;
}
- for (i = num; choices[i]; i++)
+ for (i = INITIAL_LIST_SIZE; i < n_choices; i++)
{
if (strcmp (choices[i], default_id) == 0)
{
@@ -386,11 +390,11 @@ app_chooser_dialog_new (const char **choices,
gtk_label_set_label (GTK_LABEL (dialog->heading), _("Choose an application."));
}
- dialog->choices = g_strdupv ((char **)choices);
- n_choices = g_strv_length ((char **)choices);
+ ensure_default_in_initial_list (choices, default_id);
- ensure_default_is_below (dialog->choices, default_id, MIN (n_choices, INITIAL_LIST_SIZE));
+ dialog->choices = g_strdupv ((char **)choices);
+ n_choices = g_strv_length ((char **)choices);
if (n_choices == 0)
{
gtk_widget_show (dialog->empty_box);
--
2.26.2

1
EMPTY
View File

@ -1 +0,0 @@

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (xdg-desktop-portal-gtk-1.6.0.tar.xz) = 97111e0c14a8cb54d88d0dd8142003b3f1a60e156131cce77deec0f43c936a110eda24c1e8efbb555dad0ad5aafe392d8c5afab80ea96166f616e6255371adc8

129
xdg-desktop-portal-gtk.spec Normal file
View File

@ -0,0 +1,129 @@
%global xdg_desktop_portal_version 1.1.1
Name: xdg-desktop-portal-gtk
Version: 1.6.0
Release: 1%{?dist}
Summary: Backend implementation for xdg-desktop-portal using GTK+
License: LGPLv2+
URL: https://github.com/flatpak/%{name}
Source0: https://github.com/flatpak/%{name}/releases/download/%{version}/%{name}-%{version}.tar.xz
# Bump supported mutter API version to the one including PipeWire 0.3 support. (#1837413)
Patch1: 0001-screencast-Bump-supported-Mutter-version-to-3-280.patch
# https://github.com/flatpak/xdg-desktop-portal/issues/480 (#1837413)
Patch2: 0001-appchooserdialog-avoid-crash-when-there-are-few-app-.patch
Patch3: 0002-appchooserdialog-improve-handling-of-INITIAL_LIST_SI.patch
Patch4: 0003-appchooserdialog-add-g_return-to-show_more.patch
Patch5: 0004-appchooserdialog-improve-safety-of-ensure_default-fu.patch
BuildRequires: gcc
BuildRequires: gettext
BuildRequires: pkgconfig(gtk+-unix-print-3.0)
BuildRequires: pkgconfig(xdg-desktop-portal) >= %{xdg_desktop_portal_version}
BuildRequires: gnome-desktop3-devel
%{?systemd_requires}
BuildRequires: systemd
Requires: dbus
Requires: gnome-desktop3
Requires: xdg-desktop-portal >= %{xdg_desktop_portal_version}
%if 0%{?fedora}
# Use rich deps to pull in this package when flatpak and gtk3 are both installed
Supplements: (flatpak and gtk3)
%endif
%description
A backend implementation for xdg-desktop-portal that is using GTK+ and various
pieces of GNOME infrastructure, such as the org.gnome.Shell.Screenshot or
org.gnome.SessionManager D-Bus interfaces.
%prep
%autosetup -S git
%build
%configure --disable-silent-rules
%make_build
%install
%make_install
%find_lang %{name}
%post
%systemd_user_post %{name}.service
%preun
%systemd_user_preun %{name}.service
%files -f %{name}.lang
%license COPYING
%doc NEWS
%{_libexecdir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/dbus-1/services/org.freedesktop.impl.portal.desktop.gtk.service
%{_datadir}/xdg-desktop-portal/portals/gtk.portal
%{_userunitdir}/%{name}.service
%changelog
* Mon May 25 2020 Jonas Ådahl <jadahl@redhat.com> - 1.6.0-1
- Rebase to 1.6.0 (#1837413)
- Bump supported Mutter screen cast API version (#1837413)
- Backport bugfix (#1837413)
* Sat Oct 26 2019 David King <dking@redhat.com> - 1.4.0-1
- Rebase to 1.4.0 (#1748335)
* Tue Sep 18 2018 Kalev Lember <klember@redhat.com> - 1.0.2-1
- Update to 1.0.2
* Tue Jul 31 2018 David King <dking@redhat.com> - 0.99-1
- Update to 0.99
* Wed Apr 25 2018 David King <amigadave@amigadave.com> - 0.11-1
- Update to 0.11 (#1545226)
* Wed Feb 14 2018 David King <amigadave@amigadave.com> - 0.10-1
- Update to 0.10 (#1545226)
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.9-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Sun Nov 19 2017 David King <amigadave@amigadave.com> - 0.9-1
- Update to 0.9 (#1514775)
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.7-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Tue Jun 06 2017 David King <amigadave@amigadave.com> - 0.7-1
- Update to 0.7
* Fri Mar 31 2017 David King <amigadave@amigadave.com> - 0.6-1
- Update to 0.6
* Fri Feb 17 2017 Kalev Lember <klember@redhat.com> - 0.5-3
- Use rich deps to pull in this package when flatpak and gtk3 are both installed
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Wed Jan 18 2017 David King <amigadave@amigadave.com> - 0.5-1
- Update to 0.5
* Fri Sep 02 2016 David King <amigadave@amigadave.com> - 0.3-1
- Update to 0.3
* Fri Jul 29 2016 David King <amigadave@amigadave.com> - 0.2-1
- Update to 0.2 (#1361576)
* Wed Jul 13 2016 David King <amigadave@amigadave.com> - 0.1-1
- Initial Fedora packaging