1 |
commit: ed8b6022a90b09f91868114c1a862c3ba614080f |
2 |
Author: Pacho Ramos <pacho <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Apr 14 11:50:58 2019 +0000 |
4 |
Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Apr 14 11:51:08 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ed8b6022 |
7 |
|
8 |
gnome-extra/gnome-shell-extensions-topicons-plus: Fix stacktrace when removing icon from tray |
9 |
|
10 |
Package-Manager: Portage-2.3.62, Repoman-2.3.12 |
11 |
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org> |
12 |
|
13 |
...tensions-topicons-plus-22-exit-stacktrace.patch | 62 ++++++++++++++++++++++ |
14 |
...ome-shell-extensions-topicons-plus-22-r1.ebuild | 49 +++++++++++++++++ |
15 |
2 files changed, 111 insertions(+) |
16 |
|
17 |
diff --git a/gnome-extra/gnome-shell-extensions-topicons-plus/files/gnome-shell-extensions-topicons-plus-22-exit-stacktrace.patch b/gnome-extra/gnome-shell-extensions-topicons-plus/files/gnome-shell-extensions-topicons-plus-22-exit-stacktrace.patch |
18 |
new file mode 100644 |
19 |
index 00000000000..17082b4ac4f |
20 |
--- /dev/null |
21 |
+++ b/gnome-extra/gnome-shell-extensions-topicons-plus/files/gnome-shell-extensions-topicons-plus-22-exit-stacktrace.patch |
22 |
@@ -0,0 +1,62 @@ |
23 |
+From e883e62a36c342bdf2e31af9d328b10f4ce61112 Mon Sep 17 00:00:00 2001 |
24 |
+From: Martin Wilck <mwilck@××××.com> |
25 |
+Date: Tue, 19 Mar 2019 09:39:36 +0100 |
26 |
+Subject: [PATCH] Fix shell stack trace when removing icon |
27 |
+MIME-Version: 1.0 |
28 |
+Content-Type: text/plain; charset=UTF-8 |
29 |
+Content-Transfer-Encoding: 8bit |
30 |
+ |
31 |
+This fixes stacktraces like this when an application with a tray icon exits: |
32 |
+ |
33 |
+Mar 19 09:09:53 apollon.suse.de gnome-shell[6868]: Object Shell.TrayIcon (0x5588a424ef80), has been already deallocated — impossible to access it. This might be caused by the object having been destroyed from C code using something such as destroy(), dispose(), or remove() vfuncs. |
34 |
+Mar 19 09:09:53 apollon.suse.de gnome-shell[6868]: clutter_actor_destroy: assertion 'CLUTTER_IS_ACTOR (self)' failed |
35 |
+Mar 19 09:09:53 apollon.suse.de org.gnome.Shell.desktop[6868]: == Stack trace for context 0x5588a17911b0 == |
36 |
+Mar 19 09:09:53 apollon.suse.de org.gnome.Shell.desktop[6868]: #0 5588a2b96d60 i /home/mwilck/.local/share/gnome-shell/extensions/TopIcons@×××××××.net/extension.js:127 (7feca5a061f0 @ 92) |
37 |
+--- |
38 |
+ extension.js | 22 +++++++++++++++++++++- |
39 |
+ 1 file changed, 21 insertions(+), 1 deletion(-) |
40 |
+ |
41 |
+diff --git a/extension.js b/extension.js |
42 |
+index 113b8ef..58a0433 100644 |
43 |
+--- a/extension.js |
44 |
++++ b/extension.js |
45 |
+@@ -31,6 +31,7 @@ const PanelMenu = imports.ui.panelMenu; |
46 |
+ const ExtensionUtils = imports.misc.extensionUtils; |
47 |
+ const Me = ExtensionUtils.getCurrentExtension(); |
48 |
+ const Convenience = Me.imports.convenience; |
49 |
++const Config = imports.misc.config; |
50 |
+ |
51 |
+ let settings = null; |
52 |
+ let tray = null; |
53 |
+@@ -118,7 +119,8 @@ function onTrayIconRemoved(o, icon) { |
54 |
+ let parent = icon.get_parent(); |
55 |
+ if (parent) |
56 |
+ parent.destroy(); |
57 |
+- icon.destroy(); |
58 |
++ if (!parent || !versionAtLeast('3.30', Config.PACKAGE_VERSION)) |
59 |
++ icon.destroy(); |
60 |
+ icons.splice(icons.indexOf(icon), 1); |
61 |
+ |
62 |
+ if (icons.length === 0) |
63 |
+@@ -389,3 +391,21 @@ function setSpacing() { |
64 |
+ iconsBoxLayout.set_style('spacing: ' + boxLayoutSpacing + 'px; margin_top: 2px; margin_bottom: 2px;'); |
65 |
+ |
66 |
+ } |
67 |
++ |
68 |
++// Code copied from PanelOSD extension (GPL 2.0) |
69 |
++function versionAtLeast(atleast, current) { |
70 |
++ let currentArray = current.split('.'); |
71 |
++ let major = currentArray[0]; |
72 |
++ let minor = currentArray[1]; |
73 |
++ let point = currentArray[2]; |
74 |
++ let atleastArray = atleast.split('.'); |
75 |
++ if ((atleastArray[0] < major) || |
76 |
++ (atleastArray[0] == major && |
77 |
++ atleastArray[1] < minor) || |
78 |
++ (atleastArray[0] == major && |
79 |
++ atleastArray[1] == minor) && |
80 |
++ (atleastArray[2] == undefined || |
81 |
++ atleastArray[2] <= point)) |
82 |
++ return true; |
83 |
++ return false; |
84 |
++} |
85 |
|
86 |
diff --git a/gnome-extra/gnome-shell-extensions-topicons-plus/gnome-shell-extensions-topicons-plus-22-r1.ebuild b/gnome-extra/gnome-shell-extensions-topicons-plus/gnome-shell-extensions-topicons-plus-22-r1.ebuild |
87 |
new file mode 100644 |
88 |
index 00000000000..66bb954bfdb |
89 |
--- /dev/null |
90 |
+++ b/gnome-extra/gnome-shell-extensions-topicons-plus/gnome-shell-extensions-topicons-plus-22-r1.ebuild |
91 |
@@ -0,0 +1,49 @@ |
92 |
+# Copyright 1999-2019 Gentoo Authors |
93 |
+# Distributed under the terms of the GNU General Public License v2 |
94 |
+ |
95 |
+EAPI=6 |
96 |
+inherit vcs-snapshot |
97 |
+ |
98 |
+DESCRIPTION="Moves legacy tray icons to top panel" |
99 |
+HOMEPAGE="https://extensions.gnome.org/extension/1031/topicons/" |
100 |
+SRC_URI="https://github.com/phocean/TopIcons-plus/archive/v${PV}.tar.gz -> ${P}.tar.gz" |
101 |
+ |
102 |
+LICENSE="GPL-2+" |
103 |
+SLOT="0" |
104 |
+KEYWORDS="~amd64 ~x86" |
105 |
+IUSE="" |
106 |
+ |
107 |
+# glib for glib-compile-schemas at build time, needed at runtime anyways |
108 |
+COMMON_DEPEND=" |
109 |
+ dev-libs/glib:2 |
110 |
+" |
111 |
+RDEPEND="${COMMON_DEPEND} |
112 |
+ app-eselect/eselect-gnome-shell-extensions |
113 |
+ >=gnome-base/gnome-shell-3.16 |
114 |
+" |
115 |
+DEPEND="${COMMON_DEPEND}" |
116 |
+ |
117 |
+PATCHES=( |
118 |
+ # https://github.com/phocean/TopIcons-plus/commit/e883e62a36c342bdf2e31af9d328b10f4ce61112 |
119 |
+ "${FILESDIR}"/${P}-exit-stacktrace.patch |
120 |
+) |
121 |
+ |
122 |
+#src_compile() { |
123 |
+ # It redoes this with "make install" later due to a dumb Makefile, so don't bother |
124 |
+ #make build |
125 |
+#} |
126 |
+ |
127 |
+src_install() { |
128 |
+ # TODO: Figure out if we can get the schemas to standard location, in a way that works properly runtime too |
129 |
+ make install INSTALL_PATH="${ED}usr/share/gnome-shell/extensions/" |
130 |
+ rm "${ED}/usr/share/gnome-shell/extensions/TopIcons@×××××××.net/README.md" || die |
131 |
+ # Assuming it needs only compiled gettext catalogs at runtime |
132 |
+ rm "${ED}/usr/share/gnome-shell/extensions/TopIcons@×××××××.net/locale"/*/LC_MESSAGES/*.po || die |
133 |
+ dodoc README.md |
134 |
+} |
135 |
+ |
136 |
+pkg_postinst() { |
137 |
+ ebegin "Updating list of installed extensions" |
138 |
+ eselect gnome-shell-extensions update |
139 |
+ eend $? |
140 |
+} |