diff options
author | Pacho Ramos <pacho@gentoo.org> | 2019-04-14 13:50:58 +0200 |
---|---|---|
committer | Pacho Ramos <pacho@gentoo.org> | 2019-04-14 13:51:08 +0200 |
commit | ed8b6022a90b09f91868114c1a862c3ba614080f (patch) | |
tree | 16e3baaf2f0821e394e8624eace62b97c540a44b /gnome-extra | |
parent | dev-php/swoole: amd64 stable wrt bug #669308 (diff) | |
download | gentoo-ed8b6022a90b09f91868114c1a862c3ba614080f.tar.gz gentoo-ed8b6022a90b09f91868114c1a862c3ba614080f.tar.bz2 gentoo-ed8b6022a90b09f91868114c1a862c3ba614080f.zip |
gnome-extra/gnome-shell-extensions-topicons-plus: Fix stacktrace when removing icon from tray
Package-Manager: Portage-2.3.62, Repoman-2.3.12
Signed-off-by: Pacho Ramos <pacho@gentoo.org>
Diffstat (limited to 'gnome-extra')
2 files changed, 111 insertions, 0 deletions
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 new file mode 100644 index 000000000000..17082b4ac4fd --- /dev/null +++ b/gnome-extra/gnome-shell-extensions-topicons-plus/files/gnome-shell-extensions-topicons-plus-22-exit-stacktrace.patch @@ -0,0 +1,62 @@ +From e883e62a36c342bdf2e31af9d328b10f4ce61112 Mon Sep 17 00:00:00 2001 +From: Martin Wilck <mwilck@suse.com> +Date: Tue, 19 Mar 2019 09:39:36 +0100 +Subject: [PATCH] Fix shell stack trace when removing icon +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This fixes stacktraces like this when an application with a tray icon exits: + +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. +Mar 19 09:09:53 apollon.suse.de gnome-shell[6868]: clutter_actor_destroy: assertion 'CLUTTER_IS_ACTOR (self)' failed +Mar 19 09:09:53 apollon.suse.de org.gnome.Shell.desktop[6868]: == Stack trace for context 0x5588a17911b0 == +Mar 19 09:09:53 apollon.suse.de org.gnome.Shell.desktop[6868]: #0 5588a2b96d60 i /home/mwilck/.local/share/gnome-shell/extensions/TopIcons@phocean.net/extension.js:127 (7feca5a061f0 @ 92) +--- + extension.js | 22 +++++++++++++++++++++- + 1 file changed, 21 insertions(+), 1 deletion(-) + +diff --git a/extension.js b/extension.js +index 113b8ef..58a0433 100644 +--- a/extension.js ++++ b/extension.js +@@ -31,6 +31,7 @@ const PanelMenu = imports.ui.panelMenu; + const ExtensionUtils = imports.misc.extensionUtils; + const Me = ExtensionUtils.getCurrentExtension(); + const Convenience = Me.imports.convenience; ++const Config = imports.misc.config; + + let settings = null; + let tray = null; +@@ -118,7 +119,8 @@ function onTrayIconRemoved(o, icon) { + let parent = icon.get_parent(); + if (parent) + parent.destroy(); +- icon.destroy(); ++ if (!parent || !versionAtLeast('3.30', Config.PACKAGE_VERSION)) ++ icon.destroy(); + icons.splice(icons.indexOf(icon), 1); + + if (icons.length === 0) +@@ -389,3 +391,21 @@ function setSpacing() { + iconsBoxLayout.set_style('spacing: ' + boxLayoutSpacing + 'px; margin_top: 2px; margin_bottom: 2px;'); + + } ++ ++// Code copied from PanelOSD extension (GPL 2.0) ++function versionAtLeast(atleast, current) { ++ let currentArray = current.split('.'); ++ let major = currentArray[0]; ++ let minor = currentArray[1]; ++ let point = currentArray[2]; ++ let atleastArray = atleast.split('.'); ++ if ((atleastArray[0] < major) || ++ (atleastArray[0] == major && ++ atleastArray[1] < minor) || ++ (atleastArray[0] == major && ++ atleastArray[1] == minor) && ++ (atleastArray[2] == undefined || ++ atleastArray[2] <= point)) ++ return true; ++ return false; ++} 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 new file mode 100644 index 000000000000..66bb954bfdbe --- /dev/null +++ b/gnome-extra/gnome-shell-extensions-topicons-plus/gnome-shell-extensions-topicons-plus-22-r1.ebuild @@ -0,0 +1,49 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +inherit vcs-snapshot + +DESCRIPTION="Moves legacy tray icons to top panel" +HOMEPAGE="https://extensions.gnome.org/extension/1031/topicons/" +SRC_URI="https://github.com/phocean/TopIcons-plus/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-2+" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +# glib for glib-compile-schemas at build time, needed at runtime anyways +COMMON_DEPEND=" + dev-libs/glib:2 +" +RDEPEND="${COMMON_DEPEND} + app-eselect/eselect-gnome-shell-extensions + >=gnome-base/gnome-shell-3.16 +" +DEPEND="${COMMON_DEPEND}" + +PATCHES=( + # https://github.com/phocean/TopIcons-plus/commit/e883e62a36c342bdf2e31af9d328b10f4ce61112 + "${FILESDIR}"/${P}-exit-stacktrace.patch +) + +#src_compile() { + # It redoes this with "make install" later due to a dumb Makefile, so don't bother + #make build +#} + +src_install() { + # TODO: Figure out if we can get the schemas to standard location, in a way that works properly runtime too + make install INSTALL_PATH="${ED}usr/share/gnome-shell/extensions/" + rm "${ED}/usr/share/gnome-shell/extensions/TopIcons@phocean.net/README.md" || die + # Assuming it needs only compiled gettext catalogs at runtime + rm "${ED}/usr/share/gnome-shell/extensions/TopIcons@phocean.net/locale"/*/LC_MESSAGES/*.po || die + dodoc README.md +} + +pkg_postinst() { + ebegin "Updating list of installed extensions" + eselect gnome-shell-extensions update + eend $? +} |