summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Palimaka <kensington@gentoo.org>2013-07-03 07:42:27 +0000
committerMichael Palimaka <kensington@gentoo.org>2013-07-03 07:42:27 +0000
commita0035d38935e4cf37ff556a06f6b203abd832438 (patch)
tree711958d299da40aace887375e3f2ab7a611462ca /kde-base
parentAdded check for unknown ./configure options. Followed upstream in '--with-edi... (diff)
downloadgentoo-2-a0035d38935e4cf37ff556a06f6b203abd832438.tar.gz
gentoo-2-a0035d38935e4cf37ff556a06f6b203abd832438.tar.bz2
gentoo-2-a0035d38935e4cf37ff556a06f6b203abd832438.zip
Backport patch from upstream to solve a memory leak issue, wrt bug #447862.
(Portage version: 2.1.12.11/cvs/Linux x86_64, signed Manifest commit with key 675D0D2C)
Diffstat (limited to 'kde-base')
-rw-r--r--kde-base/plasma-workspace/ChangeLog8
-rw-r--r--kde-base/plasma-workspace/files/plasma-workspace-4.10.5-leak.patch59
-rw-r--r--kde-base/plasma-workspace/plasma-workspace-4.10.5-r1.ebuild144
3 files changed, 210 insertions, 1 deletions
diff --git a/kde-base/plasma-workspace/ChangeLog b/kde-base/plasma-workspace/ChangeLog
index 3630d2e2375f..0d5ad06919fc 100644
--- a/kde-base/plasma-workspace/ChangeLog
+++ b/kde-base/plasma-workspace/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for kde-base/plasma-workspace
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/kde-base/plasma-workspace/ChangeLog,v 1.229 2013/07/02 16:48:04 johu Exp $
+# $Header: /var/cvsroot/gentoo-x86/kde-base/plasma-workspace/ChangeLog,v 1.230 2013/07/03 07:42:27 kensington Exp $
+
+*plasma-workspace-4.10.5-r1 (03 Jul 2013)
+
+ 03 Jul 2013; Michael Palimaka <kensington@gentoo.org>
+ +files/plasma-workspace-4.10.5-leak.patch, +plasma-workspace-4.10.5-r1.ebuild:
+ Backport patch from upstream to solve a memory leak issue, wrt bug #447862.
*plasma-workspace-4.10.5 (02 Jul 2013)
diff --git a/kde-base/plasma-workspace/files/plasma-workspace-4.10.5-leak.patch b/kde-base/plasma-workspace/files/plasma-workspace-4.10.5-leak.patch
new file mode 100644
index 000000000000..d4e2c5d6033d
--- /dev/null
+++ b/kde-base/plasma-workspace/files/plasma-workspace-4.10.5-leak.patch
@@ -0,0 +1,59 @@
+From ec8e405ca447ba5bc5a9f6a2a12e2fa90412a0d4 Mon Sep 17 00:00:00 2001
+From: Andreas Hartmetz <ahartmetz@gmail.com>
+Date: Tue, 2 Jul 2013 18:35:35 +0200
+Subject: [PATCH] Fix pixmap leak when the tray icon changes (e.g. when it's
+ animated).
+
+This could easily leak 4KB/second of X pixmap memory.
+All the actual difference comes from the QPixmap::ExplicitlyShared
+argument, the rest is making some wonky-looking but working code look
+less wonky.
+
+BUG: 314919
+---
+ .../systemtray/protocols/fdo/x11embedcontainer.cpp | 19 ++++++++++---------
+ 1 file changed, 10 insertions(+), 9 deletions(-)
+
+diff --git a/plasma/generic/applets/systemtray/protocols/fdo/x11embedcontainer.cpp b/plasma/generic/applets/systemtray/protocols/fdo/x11embedcontainer.cpp
+index 1826512..a5bc826 100644
+--- a/plasma/generic/applets/systemtray/protocols/fdo/x11embedcontainer.cpp
++++ b/plasma/generic/applets/systemtray/protocols/fdo/x11embedcontainer.cpp
+@@ -194,8 +194,7 @@ void X11EmbedContainer::paintEvent(QPaintEvent *event)
+
+ // Taking a detour via a QPixmap is unfortunately the only way we can get
+ // the window contents into Qt's backing store.
+- QPixmap pixmap(size());
+- pixmap = toX11Pixmap(pixmap);
++ QPixmap pixmap = toX11Pixmap(QPixmap(size()));
+ pixmap.fill(Qt::transparent);
+ XRenderComposite(x11Info().display(), PictOpSrc, d->picture, None, pixmap.x11PictureHandle(),
+ 0, 0, 0, 0, 0, 0, width(), height());
+@@ -232,16 +231,18 @@ void X11EmbedContainer::setBackgroundPixmap(QPixmap background)
+ // NOTE: The alpha-channel is not preserved if it exists, but for X pixmaps it generally should not be needed anyway.
+ QPixmap X11EmbedContainer::toX11Pixmap(const QPixmap& pix)
+ {
+- if(pix.handle() != 0) // X11 pixmap
++ if (pix.handle() != 0) // X11 pixmap
+ return pix;
++ QPixmap ret;
+ Pixmap xpix = XCreatePixmap(pix.x11Info().display(), RootWindow(pix.x11Info().display(), pix.x11Info().screen()),
+ pix.width(), pix.height(), QX11Info::appDepth());
+- QPixmap wrk = QPixmap::fromX11Pixmap(xpix);
+- QPainter paint(&wrk);
+- paint.drawPixmap(0, 0, pix);
+- paint.end();
+- QPixmap ret = wrk.copy();
+- wrk = QPixmap(); // reset, so that xpix can be freed (QPixmap does not own it)
++ {
++ QPixmap wrk = QPixmap::fromX11Pixmap(xpix, QPixmap::ExplicitlyShared);
++ QPainter paint(&wrk);
++ paint.drawPixmap(0, 0, pix);
++ paint.end();
++ ret = wrk.copy();
++ } // free resources so that xpix can be freed (QPixmap does not own it)
+ XFreePixmap(pix.x11Info().display(), xpix);
+ return ret;
+ }
+--
+1.8.2.1
+
diff --git a/kde-base/plasma-workspace/plasma-workspace-4.10.5-r1.ebuild b/kde-base/plasma-workspace/plasma-workspace-4.10.5-r1.ebuild
new file mode 100644
index 000000000000..d0c260b63254
--- /dev/null
+++ b/kde-base/plasma-workspace/plasma-workspace-4.10.5-r1.ebuild
@@ -0,0 +1,144 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/kde-base/plasma-workspace/plasma-workspace-4.10.5-r1.ebuild,v 1.1 2013/07/03 07:42:27 kensington Exp $
+
+EAPI=5
+
+DECLARATIVE_REQUIRED="always"
+KDE_HANDBOOK="optional"
+KMNAME="kde-workspace"
+KMMODULE="plasma"
+PYTHON_DEPEND="python? 2"
+OPENGL_REQUIRED="always"
+inherit python kde4-meta
+
+DESCRIPTION="Plasma: KDE desktop framework"
+KEYWORDS=" ~amd64 ~arm ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="debug gps json python qalculate +rss semantic-desktop"
+
+COMMONDEPEND="
+ dev-libs/libdbusmenu-qt
+ >=dev-qt/qtcore-4.8.4-r3:4
+ !kde-misc/ktouchpadenabler
+ $(add_kdebase_dep kactivities)
+ $(add_kdebase_dep kdelibs 'semantic-desktop(+)?')
+ $(add_kdebase_dep kephal)
+ $(add_kdebase_dep ksysguard)
+ $(add_kdebase_dep libkworkspace)
+ $(add_kdebase_dep libplasmagenericshell)
+ $(add_kdebase_dep libtaskmanager)
+ $(add_kdebase_dep solid)
+ x11-libs/libX11
+ x11-libs/libXcomposite
+ x11-libs/libXdamage
+ x11-libs/libXext
+ x11-libs/libXfixes
+ x11-libs/libXi
+ x11-libs/libXrender
+ gps? ( >=sci-geosciences/gpsd-2.37 )
+ json? ( dev-libs/qjson )
+ python? (
+ >=dev-python/PyQt4-4.4.0[X]
+ $(add_kdebase_dep pykde4)
+ )
+ qalculate? ( sci-libs/libqalculate )
+ rss? (
+ $(add_kdebase_dep kdepimlibs 'semantic-desktop(+)?')
+ $(add_kdebase_dep libplasmaclock 'holidays(+)')
+ )
+ !rss? ( $(add_kdebase_dep libplasmaclock '-holidays(+)') )
+ semantic-desktop? (
+ dev-libs/soprano
+ $(add_kdebase_dep nepomuk-core)
+ )
+"
+DEPEND="${COMMONDEPEND}
+ rss? ( dev-libs/boost )
+ x11-proto/compositeproto
+ x11-proto/damageproto
+ x11-proto/fixesproto
+ x11-proto/renderproto
+"
+RDEPEND="${COMMONDEPEND}
+ $(add_kdebase_dep plasma-runtime)
+"
+
+KMEXTRA="
+ appmenu/
+ ktouchpadenabler/
+ statusnotifierwatcher/
+"
+KMEXTRACTONLY="
+ kcheckpass/
+ krunner/dbus/org.freedesktop.ScreenSaver.xml
+ krunner/dbus/org.kde.krunner.App.xml
+ ksmserver/org.kde.KSMServerInterface.xml
+ ksmserver/screenlocker/
+ libs/kephal/
+ libs/kworkspace/
+ libs/taskmanager/
+ libs/plasmagenericshell/
+ libs/ksysguard/
+ libs/kdm/kgreeterplugin.h
+ ksysguard/
+"
+
+KMLOADLIBS="libkworkspace libplasmaclock libplasmagenericshell libtaskmanager"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-4.10.1-noplasmalock.patch"
+ "${FILESDIR}/${PN}-4.10.5-leak.patch"
+)
+
+pkg_setup() {
+ if use python ; then
+ python_set_active_version 2
+ python_pkg_setup
+ fi
+ kde4-meta_pkg_setup
+}
+
+src_unpack() {
+ if use handbook; then
+ KMEXTRA+=" doc/plasma-desktop"
+ fi
+
+ kde4-meta_src_unpack
+}
+
+src_configure() {
+ mycmakeargs=(
+ $(cmake-utils_use_with gps libgps)
+ $(cmake-utils_use_with json QJSON)
+ $(cmake-utils_use_with python PythonLibrary)
+ $(cmake-utils_use_with qalculate)
+ $(cmake-utils_use_with rss KdepimLibs)
+ $(cmake-utils_use_with semantic-desktop Akonadi)
+ $(cmake-utils_use_with semantic-desktop NepomukCore)
+ $(cmake-utils_use_with semantic-desktop Soprano)
+ -DWITH_Googlegadgets=OFF
+ -DWITH_Xmms=OFF
+ )
+
+ kde4-meta_src_configure
+}
+
+pkg_postinst() {
+ kde4-meta_pkg_postinst
+
+ if use python; then
+ python_mod_optimize \
+ PyKDE4/plasmascript.py \
+ /usr/share/apps/plasma_scriptengine_python
+ fi
+}
+
+pkg_postrm() {
+ kde4-meta_pkg_postrm
+
+ if use python; then
+ python_mod_cleanup \
+ PyKDE4/plasmascript.py \
+ /usr/share/apps/plasma_scriptengine_python
+ fi
+}