import xdg-desktop-portal-gtk-1.8.0-1.el8

This commit is contained in:
CentOS Sources 2022-04-13 02:12:34 +00:00 committed by Stepan Oksanichenko
parent c4ff2840a0
commit 5e20d9cc38
8 changed files with 17 additions and 263 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/xdg-desktop-portal-gtk-1.6.0.tar.xz
SOURCES/xdg-desktop-portal-gtk-1.8.0.tar.xz

View File

@ -1 +1 @@
def673d34fd81610aea81ae062a34d1fa64ffdc5 SOURCES/xdg-desktop-portal-gtk-1.6.0.tar.xz
cf281335a301828c4b92e91ebf09113e3f485e18 SOURCES/xdg-desktop-portal-gtk-1.8.0.tar.xz

View File

@ -1,38 +0,0 @@
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

@ -1,46 +0,0 @@
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

@ -1,61 +0,0 @@
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

@ -1,31 +0,0 @@
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

@ -1,69 +0,0 @@
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

View File

@ -1,7 +1,8 @@
%global xdg_desktop_portal_version 1.1.1
# Required for xdp_impl_background_emit_running_applications_changed
%global xdg_desktop_portal_version 1.5.4
Name: xdg-desktop-portal-gtk
Version: 1.6.0
Version: 1.8.0
Release: 1%{?dist}
Summary: Backend implementation for xdg-desktop-portal using GTK+
@ -9,28 +10,21 @@ 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: make
BuildRequires: gcc
BuildRequires: gettext
BuildRequires: pkgconfig(fontconfig)
BuildRequires: pkgconfig(gnome-desktop-3.0)
BuildRequires: pkgconfig(gsettings-desktop-schemas)
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)
# Use rich deps to pull in this package when gtk3 and flatpak (or snapd) are both installed
Supplements: (gtk3 and (flatpak or snapd))
%endif
%description
@ -40,7 +34,7 @@ org.gnome.SessionManager D-Bus interfaces.
%prep
%autosetup -S git
%autosetup -p1
%build
@ -72,6 +66,11 @@ org.gnome.SessionManager D-Bus interfaces.
%changelog
* Sat Mar 26 2022 Debarshi Ray <rishi@fedoraproject.org> - 1.8.0-1
- Rebase to 1.8.0
- Remove unnecessary non-arch-specific explicit library Requires
Resolves: #2062432
* 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)