From 93ad91620445d6dea92daefe8259c414224d46c6 Mon Sep 17 00:00:00 2001 From: liyuan Date: Thu, 19 Oct 2023 20:38:43 +0800 Subject: [PATCH] backport Several fixes for scp-dbus-service --- ...ersion-of-GDK-and-GTK-in-scp-dbus-se.patch | 35 ++++++++++++++++ ...me-name-for-scp-dbus-service-as-well.patch | 41 +++++++++++++++++++ system-config-printer.spec | 8 +++- 3 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 0002-Require-proper-version-of-GDK-and-GTK-in-scp-dbus-se.patch create mode 100644 0003-Set-programe-name-for-scp-dbus-service-as-well.patch diff --git a/0002-Require-proper-version-of-GDK-and-GTK-in-scp-dbus-se.patch b/0002-Require-proper-version-of-GDK-and-GTK-in-scp-dbus-se.patch new file mode 100644 index 0000000..3be1266 --- /dev/null +++ b/0002-Require-proper-version-of-GDK-and-GTK-in-scp-dbus-se.patch @@ -0,0 +1,35 @@ +From 3fee7c63c3aba395a3d8cf0bf4ea0fd2fae695ae Mon Sep 17 00:00:00 2001 +From: Laurent Bigonville +Date: Mon, 26 Feb 2018 11:54:10 +0100 +Subject: [PATCH] Require proper version of GDK and GTK in scp-dbus-service as + well + +scp-dbus-service can be D-Bus activated, that means that +gi.require_version() is not called before. + +That needs to be kept in sync with the required version in the main +program file. +--- + scp-dbus-service.py | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/scp-dbus-service.py b/scp-dbus-service.py +index f0f51efc..3aefc6c6 100644 +--- a/scp-dbus-service.py ++++ b/scp-dbus-service.py +@@ -21,9 +21,12 @@ + ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + import dbus.service ++import gi + from gi.repository import GObject + from gi.repository import GLib ++gi.require_version('Gdk', '3.0') + from gi.repository import Gdk ++gi.require_version('Gtk', '3.0') + from gi.repository import Gtk + import sys + +-- +2.33.0 + diff --git a/0003-Set-programe-name-for-scp-dbus-service-as-well.patch b/0003-Set-programe-name-for-scp-dbus-service-as-well.patch new file mode 100644 index 0000000..502c586 --- /dev/null +++ b/0003-Set-programe-name-for-scp-dbus-service-as-well.patch @@ -0,0 +1,41 @@ +From d818802daefd66eafbcc1618dc731e65de3e08b8 Mon Sep 17 00:00:00 2001 +From: Laurent Bigonville +Date: Mon, 26 Feb 2018 13:59:26 +0100 +Subject: [PATCH] Set programe name for scp-dbus-service as well + +scp-dbus-service can be D-Bus activated, that means that the program +name is never set meaning that the icon and the fancy name in the window +list is never set. + +This completes the fix for bug #53 +--- + scp-dbus-service.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/scp-dbus-service.py b/scp-dbus-service.py +index 3aefc6c6..1338836b 100644 +--- a/scp-dbus-service.py ++++ b/scp-dbus-service.py +@@ -20,8 +20,8 @@ + ## along with this program; if not, write to the Free Software + ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +-import dbus.service + import gi ++import dbus.service + from gi.repository import GObject + from gi.repository import GLib + gi.require_version('Gdk', '3.0') +@@ -55,6 +55,9 @@ CONFIG_JOBVIEWER_IFACE=CONFIG_IFACE + ".JobViewer" + g_ppds = None + g_killtimer = None + ++#set program name ++GLib.set_prgname("system-config-printer") ++ + class FetchedPPDs(GObject.GObject): + __gsignals__ = { + 'ready': (GObject.SIGNAL_RUN_LAST, None, ()), +-- +2.33.0 + diff --git a/system-config-printer.spec b/system-config-printer.spec index b3f9a79..368db4e 100644 --- a/system-config-printer.spec +++ b/system-config-printer.spec @@ -3,12 +3,14 @@ Name: system-config-printer Summary: a graphical tool for CUPS administration Version: 1.5.11 -Release: 16 +Release: 17 License: GPLv2+ URL: https://github.com/zdohnal/system-config-printer Source0: https://github.com/zdohnal/system-config-printer/archive/%{version}.tar.gz Patch0001: 0001-Fix-constructing-the-auth-dialog.patch +Patch0002: 0002-Require-proper-version-of-GDK-and-GTK-in-scp-dbus-se.patch +Patch0003: 0003-Set-programe-name-for-scp-dbus-service-as-well.patch BuildRequires: libusb1-devel gcc gettext-devel systemd xmlto systemd-devel python3-devel BuildRequires: intltool cups-devel >= 1.2 desktop-file-utils >= 0.2.92 pkgconfig(glib-2.0) @@ -84,6 +86,10 @@ rm -rf /var/cache/foomatic/foomatic.pickle exit 0 %changelog +* Thu Oct 19 2023 liyuanyuan - 1.5.11-17 +- Set programe name for scp-dbus-service as well +- Require proper version of GDK and GTK in scp-dbus-service as well + * Thu Oct 12 2023 liyuanyuan - 1.5.11-16 - Fix constructing the auth dialog -- Gitee