From 788f32cceb250a37ab1e6135dde1fb23fc9d0ab7 Mon Sep 17 00:00:00 2001 From: Script Kiddy Date: Fri, 13 Jan 2012 09:05:07 +0100 Subject: [PATCH 1/2] SVN_SILENT made messages (.desktop file) --- effects/highlightwindow/highlightwindow.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/effects/highlightwindow/highlightwindow.desktop b/effects/highlightwindow/highlightwindow.desktop index d29add41ce..ed0cdddf51 100644 --- a/effects/highlightwindow/highlightwindow.desktop +++ b/effects/highlightwindow/highlightwindow.desktop @@ -89,7 +89,7 @@ Comment[fi]=Korostaa ikkunaa, jonka kohdalla hiiri on tehtävärivillä Comment[fr]=Met en évidence la fenêtre appropriée lorsque le curseur survole son icône dans le gestionnaire des tâches Comment[fy]=Markearje it juste finster as jo sweve boppe de taakbalke ynfier Comment[ga]=Aibhsigh an fhuinneog chuí nuair atá an cúrsóir os cionn iontrála sa tascbharra -Comment[gl]=Realza a xanela apropriada ao pasar o rato sobre a barra de tarefas +Comment[gl]=Realza a xanela apropiada ao pasar o rato sobre a barra de tarefas Comment[he]=הבלטת החלון המתאים במעבר בין פריטים בשורת המשימות Comment[hr]=Označi odgovarajući prozor kad se mišem prijeđe preko stavki u programskoj traci Comment[hu]=Ha az egérmutató egy ablakbejegyzés fölé kerül a feladatsávon, a megfelelő ablak kiemelést kap From 07685da24e5ade698b10e1d13d227b0d0e4f72d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 13 Jan 2012 09:01:36 +0100 Subject: [PATCH 2/2] Check whether the ShaderManager is valid in Explosion effect The effect did not check whether the ShaderManager is valid causing a null pointer access when trying to use the shader. Additionally this change moves the Shader init into the close window slot as close window referrenced windows without checking whether the effect would work. If the effect would not work each closed window would be referrenced without any chance to being unreffed again as this code is in a block checking whether the effect is valid. BUG: 291390 FIXED-IN: 4.8.0 --- effects/explosion/explosion.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/effects/explosion/explosion.cpp b/effects/explosion/explosion.cpp index bdff254f54..dc9cd1441e 100644 --- a/effects/explosion/explosion.cpp +++ b/effects/explosion/explosion.cpp @@ -67,6 +67,9 @@ bool ExplosionEffect::supported() bool ExplosionEffect::loadData() { mInited = true; + if (!ShaderManager::instance()->isValid()) { + return false; + } QString shadername("explosion"); const QString fragmentshader = KGlobal::dirs()->findResource("data", "kwin/explosion.frag"); QString starttexture = KGlobal::dirs()->findResource("data", "kwin/explosion-start.png"); @@ -113,8 +116,6 @@ void ExplosionEffect::prePaintScreen(ScreenPrePaintData& data, int time) void ExplosionEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time) { if (mWindows.contains(w)) { - if (mValid && !mInited) - mValid = loadData(); if (mValid) { mWindows[ w ] += time / animationTime(700.0); // complete change in 700ms if (mWindows[ w ] < 1) { @@ -190,6 +191,12 @@ void ExplosionEffect::slotWindowClosed(EffectWindow* c) if (e && e != this) return; if (c->isOnCurrentDesktop() && !c->isMinimized()) { + if (mValid && !mInited) + mValid = loadData(); + if (!mValid) { + // don't add to list as we cannot animate this window; + return; + } mWindows[ c ] = 0; // count up to 1 c->addRepaintFull(); c->refWindow();