Commit 3b8984d6 authored by Martin Flöser's avatar Martin Flöser

Remove Shadow Effect.

The shadow effect is known to be broken since at least 4.5.
It is unfortunately in a state which makes it difficult to maintain
and the architecture has some serious drawbacks. Therefore it is the
best solution to replace the effect with a new and better
implementation. For more information about the new implementation
please see the discussion on KWin mailinglist:
http://lists.kde.org/?l=kwin&m=129607406517609&w=2

This also "fixes" all existing bug reports about the shadow effect.
Most of the bugs will really be fixed when the new shadow system is
implemented, if not it is a new bug and a new report should be created
for it.

Please excuse that we go this unnormal approach to mark bugs as
fixed with code removal.
BUG: 164084
BUG: 160948
BUG: 189241
BUG: 229164
BUG: 258663
BUG: 216709
BUG: 243890
FIXED-IN: 4.7.0
parent 8ba7e86a
......@@ -84,7 +84,6 @@ include( zoom/CMakeLists.txt )
if( NOT KWIN_HAVE_OPENGLES_COMPOSITING )
include( logout/CMakeLists.txt )
include( shadow/CMakeLists.txt )
endif( NOT KWIN_HAVE_OPENGLES_COMPOSITING )
# OpenGL-specific effects
......
......@@ -34,10 +34,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "thumbnailaside/thumbnailaside_config.h"
#include "zoom/zoom_config.h"
#ifndef KWIN_HAVE_OPENGLES
#include "shadow/shadow_config.h"
#endif
#ifdef KWIN_HAVE_OPENGL_COMPOSITING
#include "blur/blur_config.h"
#include "coverswitch/coverswitch_config.h"
......@@ -72,9 +68,6 @@ KWIN_EFFECT_CONFIG_MULTIPLE( builtins,
KWIN_EFFECT_CONFIG_SINGLE( translucency, TranslucencyEffectConfig )
KWIN_EFFECT_CONFIG_SINGLE( thumbnailaside, ThumbnailAsideEffectConfig )
KWIN_EFFECT_CONFIG_SINGLE( zoom, ZoomEffectConfig )
#ifndef KWIN_HAVE_OPENGLES
KWIN_EFFECT_CONFIG_SINGLE( shadow, ShadowEffectConfig )
#endif
#ifdef KWIN_HAVE_OPENGL_COMPOSITING
KWIN_EFFECT_CONFIG_SINGLE( blur, BlurEffectConfig )
......
#######################################
# Effect
# Source files
set( kwin4_effect_builtins_sources ${kwin4_effect_builtins_sources}
shadow/shadow.cpp
)
# .desktop files
install( FILES
shadow/shadow.desktop
DESTINATION ${SERVICES_INSTALL_DIR}/kwin )
# Data files
install( FILES
shadow/data/shadow-texture.png
DESTINATION ${DATA_INSTALL_DIR}/kwin )
#######################################
# Config
# Source files
set( kwin4_effect_builtins_config_sources ${kwin4_effect_builtins_config_sources}
shadow/shadow_config.cpp
shadow/shadow_config.ui
)
# .desktop files
install( FILES
shadow/shadow_config.desktop
DESTINATION ${SERVICES_INSTALL_DIR}/kwin )
This diff is collapsed.
[Desktop Entry]
Name=Shadow
Name[af]=Skaduwee
Name[ar]=ظل
Name[ast]=Solombra
Name[be]=Цень
Name[be@latin]=Cień
Name[bg]=Сянка
Name[bn]=ছায়া
Name[bn_IN]=ছায়া
Name[ca]=Ombra
Name[ca@valencia]=Ombra
Name[cs]=Stín
Name[csb]=Ceniô
Name[da]=Skygge
Name[de]=Schatten
Name[el]=Σκιά
Name[en_GB]=Shadow
Name[eo]=Ombro
Name[es]=Sombra
Name[et]=Vari
Name[eu]=Itzala
Name[fa]=سایه
Name[fi]=Varjo
Name[fr]=Ombre
Name[fy]=Skaad
Name[ga]=Scáth
Name[gl]=Sombra
Name[gu]=પડછાયો
Name[he]=צל
Name[hi]=छाया
Name[hne]=छइंहा
Name[hr]=Sjena
Name[hu]=Árnyékolt ablakok
Name[ia]=Umbra
Name[id]=Bayang
Name[is]=Skuggi
Name[it]=Ombra
Name[ja]=影付け
Name[kk]=Көлеңке
Name[km]=ស្រមោល​
Name[kn]=ನೆರಳು
Name[ko]=그림자
Name[ku]=Sî
Name[lt]=Šešėlis
Name[lv]=Ēna
Name[mai]=छाया
Name[mk]=Сенка
Name[ml]=നിഴല്‍
Name[mr]=छायाकृती
Name[nb]=Skyggelegg
Name[nds]=Schadden
Name[ne]=छायाँ
Name[nl]=Schaduw
Name[nn]=Vindaugsskuggar
Name[oc]=Ombra
Name[pa]=ਛਾਂ
Name[pl]=Cień
Name[pt]=Sombra
Name[pt_BR]=Sombra
Name[ro]=Umbră
Name[ru]=Тень
Name[se]=Suoivvanastte
Name[si]=සෙවණැල්ල
Name[sk]=Tieň
Name[sl]=Senca
Name[sr]=Сенка
Name[sr@ijekavian]=Сијенка
Name[sr@ijekavianlatin]=Sijenka
Name[sr@latin]=Senka
Name[sv]=Skugga
Name[ta]=நிழல்
Name[te]=నీ‍డ
Name[tg]=Соя
Name[th]=เงา
Name[tr]=Gölge
Name[uk]=Тінь
Name[uz]=Soya
Name[uz@cyrillic]=Соя
Name[vi]=Bóng
Name[wa]=Ombion
Name[x-test]=xxShadowxx
Name[zh_CN]=阴影
Name[zh_TW]=陰影
Icon=preferences-system-windows-effect-shadow
Comment=Draw shadows under windows
Comment[ar]=يضيف ظلاً تحت النوافذ
Comment[ast]=Amiesta una solombra embaxo les ventanes
Comment[be@latin]=Maluj cień pad voknami.
Comment[bg]=Добавяне на сянка под прозорците
Comment[ca]=Afegeix ombres a sota de les finestres
Comment[ca@valencia]=Afig ombres a sota de les finestres
Comment[cs]=Přidává stíny pod okna
Comment[csb]=Céchùje ceniô pòd òknama
Comment[da]=Tegn skygger under vinduer
Comment[de]=Lässt Fenster einen Schatten werfen.
Comment[el]=Σχεδίαση σκιάς κάτω από τα παράθυρα
Comment[en_GB]=Draw shadows under windows
Comment[eo]=Aldonas ombron sub la fenestrojn
Comment[es]=Añade una sombra bajo las ventanas
Comment[et]=Lisab akende alla varju
Comment[eu]=Leihoen azpian itzala gehitzen du
Comment[fi]=Lisää varjon ikkunoille
Comment[fr]=Dessine des ombres sous les fenêtres
Comment[fy]=Soarget foar skaad ûnder de finsters
Comment[ga]=Cuir scáthanna faoi fhuinneoga
Comment[gl]=Debuxa sombras baixo as xanelas
Comment[gu]=વિન્ડોની નીચે પડછાયો ઉમેરો
Comment[he]=הוספת צל מתחת לחלונות
Comment[hi]=विंडो के अंदर छाया डालता है
Comment[hne]=विंडो के अंदर छइंहा डालथे
Comment[hr]=Crtanje sjena ispod prozora
Comment[hu]=Árnyékolást ad az ablakokhoz
Comment[ia]=Designa umbras sub fenestras
Comment[id]=Gambar bayangan di bawah jendela
Comment[is]=Bætir við skuggum undir glugga
Comment[it]=Disegna un'ombra sotto le finestre
Comment[ja]=ウィンドウの下に影を付けます
Comment[kk]=Терезелердің астына қолеңкесін қосады
Comment[km]=បន្ថែម​ស្រមោល​ក្រោម​បង្អួច​
Comment[kn]=ಕಿಟಕಿಗಳ ಅಡಿಯಲ್ಲಿ ನೆರಳನ್ನು ಚಿತ್ರಿಸು
Comment[ko]=창 아래에 그림자를 그립니다
Comment[lt]=Piešia šešėlius po langais
Comment[lv]=Zīmē ēnas zem logiem
Comment[mk]=Додава сенки под прозорците
Comment[ml]=ജാലകങ്ങള്‍ക്കടിയില്‍ നിഴല്‍ കാണിക്കുക
Comment[mr]=चौकट अंतर्गत छाया काढा
Comment[nb]=Tegn skygge under vinduer
Comment[nds]=Schaddens nerrn Finstern tofögen
Comment[nl]=Voegt een schaduw toe aan de vensters
Comment[nn]=Legg skuggar under alle vindauga
Comment[pa]=ਵਿੰਡੋ ਹੇਠ ਛਾਂ ਸ਼ਾਮਲ ਕਰਦਾ ਹੈ।
Comment[pl]=Dodaje cień pod oknami
Comment[pt]=Desenhar sombras sob as janelas
Comment[pt_BR]=Adiciona sombra sob as janelas
Comment[ro]=Desenează umbre sub ferestre
Comment[ru]=Показывать тень под окнами
Comment[si]=කවුළු යට සෙවණැලි පෙන්වන්න
Comment[sk]=Zobrazí tiene pod oknami
Comment[sl]=Pod okni se izriše senca
Comment[sr]=Црта сенку испод прозора
Comment[sr@ijekavian]=Црта сијенку испод прозора
Comment[sr@ijekavianlatin]=Crta sijenku ispod prozora
Comment[sr@latin]=Crta senku ispod prozora
Comment[sv]=Rita skuggor under fönster
Comment[ta]=Draw shadows under windows
Comment[tg]=Полоса &захвата под окнами
Comment[th]=วาดเงาภายใต้หน้าต่าง
Comment[tr]=Pencerelerin altına gölge ekle
Comment[uk]=Малювання тіней під вікнами
Comment[x-test]=xxDraw shadows under windowsxx
Comment[zh_CN]=在窗口下面绘制阴影
Comment[zh_TW]=在視窗底下加上陰影
Type=Service
X-KDE-ServiceTypes=KWin/Effect
X-KDE-PluginInfo-Author=Luboš Luňák
X-KDE-PluginInfo-Email=l.lunak@kde.org
X-KDE-PluginInfo-Name=kwin4_effect_shadow
X-KDE-PluginInfo-Version=0.1.0
X-KDE-PluginInfo-Category=Appearance
X-KDE-PluginInfo-Depends=
X-KDE-PluginInfo-License=GPL
X-KDE-PluginInfo-EnabledByDefault=true
X-KDE-Library=kwin4_effect_builtins
X-KDE-Ordering=80
/********************************************************************
KWin - the KDE window manager
This file is part of the KDE project.
Copyright (C) 2007 Lubos Lunak <l.lunak@kde.org>
Copyright (C) 2008 Lucas Murray <lmurray@undefinedfire.com>
Copyright (C) 2008 Martin Gräßlin <ubuntu@martin-graesslin.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/
#ifndef KWIN_SHADOW_H
#define KWIN_SHADOW_H
#include <kwineffects.h>
#include <kwinxrenderutils.h>
namespace KWin
{
class GLTexture;
class ShadowEffect
: public QObject, public Effect
{
Q_OBJECT
public:
ShadowEffect();
virtual ~ShadowEffect();
virtual void reconfigure( ReconfigureFlags );
virtual void prePaintWindow( EffectWindow* w, WindowPrePaintData& data, int time );
virtual void drawWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data );
virtual void paintScreen( int mask, QRegion region, ScreenPaintData& data );
virtual void windowAdded( EffectWindow* c );
virtual void windowClosed( EffectWindow* c );
virtual void buildQuads( EffectWindow* w, WindowQuadList& quadList );
virtual QRect transformWindowDamage( EffectWindow* w, const QRect& r );
virtual void propertyNotify( EffectWindow* w, long atom );
private slots:
void updateShadowColor();
private:
void prepareRenderStates( GLTexture *texture, double opacity, double brightness, double saturation );
void restoreRenderStates( GLTexture *texture, double opacity, double brightness, double saturation );
void drawShadowQuadOpenGL( GLTexture *texture, QVector<float> verts, QVector<float> texCoords,
QRegion region, float opacity, float brightness, float saturation, GLShader* shader );
void drawShadowQuadXRender( XRenderPicture *picture, QRect rect, float xScale, float yScale,
QColor color, float opacity, float brightness, float saturation );
void drawShadow( EffectWindow* w, int mask, QRegion region, const WindowPaintData& data );
void addQuadVertices(QVector<float>& verts, float x1, float y1, float x2, float y2) const;
// transforms window rect -> shadow rect
QRect shadowRectangle( EffectWindow* w, const QRect& windowRectangle ) const;
bool useShadow( EffectWindow* w ) const;
void drawQueuedShadows( EffectWindow* behindWindow );
int shadowXOffset, shadowYOffset;
double shadowOpacity;
int shadowFuzzyness;
int shadowSize;
bool intensifyActiveShadow;
QColor shadowColor, cachedColor;
Atom shadowOverride;
#ifdef KWIN_HAVE_OPENGL_COMPOSITING
QList<GLTexture*> mDefaultShadowTextures;
#endif
#ifdef KWIN_HAVE_XRENDER_COMPOSITING
QList<XRenderPicture*> mDefaultShadowPics;
XRenderPicture cachedBlendPicture;
#endif
WindowQuadType mDefaultShadowQuadType;
struct ShadowData
{
ShadowData(EffectWindow* _w, WindowPaintData& _data) : w(_w), data(_data) {}
EffectWindow* w;
QRegion clip;
int mask;
QRegion region;
WindowPaintData data;
};
QList<ShadowData> shadowDatas;
};
} // namespace
#endif
/********************************************************************
KWin - the KDE window manager
This file is part of the KDE project.
Copyright (C) 2007 Rivo Laks <rivolaks@hot.ee>
Copyright (C) 2008 Lucas Murray <lmurray@undefinedfire.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/
#include "shadow_config.h"
#include "shadow_helper.h"
#include <kwineffects.h>
#include <kcolorscheme.h>
#include <QtDBus/QtDBus>
#include <QVBoxLayout>
#include <QColor>
namespace KWin
{
KWIN_EFFECT_CONFIG_FACTORY
ShadowEffectConfigForm::ShadowEffectConfigForm(QWidget* parent) : QWidget(parent)
{
setupUi(this);
}
ShadowEffectConfig::ShadowEffectConfig(QWidget* parent, const QVariantList& args)
: KCModule( EffectFactory::componentData(), parent, args )
{
m_ui = new ShadowEffectConfigForm( this );
QVBoxLayout* layout = new QVBoxLayout( this );
layout->addWidget( m_ui );
connect( m_ui->xOffsetSpin, SIGNAL( valueChanged( int )), this, SLOT( changed() ));
connect( m_ui->yOffsetSpin, SIGNAL( valueChanged( int )), this, SLOT( changed() ));
connect( m_ui->opacitySpin, SIGNAL( valueChanged( int )), this, SLOT( changed() ));
connect( m_ui->fuzzinessSpin, SIGNAL( valueChanged( int )), this, SLOT( changed() ));
connect( m_ui->sizeSpin, SIGNAL( valueChanged( int )), this, SLOT( changed() ));
connect( m_ui->colorButton, SIGNAL( changed( QColor )), this, SLOT( changed() ));
connect( m_ui->strongerActiveBox, SIGNAL( stateChanged( int )), this, SLOT( changed() ));
load();
}
ShadowEffectConfig::~ShadowEffectConfig()
{
}
void ShadowEffectConfig::load()
{
KCModule::load();
KConfigGroup conf = EffectsHandler::effectConfig( "Shadow" );
m_ui->xOffsetSpin->setValue( conf.readEntry( "XOffset", 0 ));
m_ui->yOffsetSpin->setValue( conf.readEntry( "YOffset", 3 ));
m_ui->opacitySpin->setValue( (int)( conf.readEntry( "Opacity", 0.25 ) * 100 ));
m_ui->fuzzinessSpin->setValue( conf.readEntry( "Fuzzyness", 10 ));
m_ui->sizeSpin->setValue( conf.readEntry( "Size", 5 ));
m_ui->colorButton->setColor( conf.readEntry( "Color", schemeShadowColor() ));
m_ui->strongerActiveBox->setChecked( conf.readEntry( "IntensifyActiveShadow", true ));
emit changed(false);
}
void ShadowEffectConfig::save()
{
KCModule::save();
KConfigGroup conf = EffectsHandler::effectConfig( "Shadow" );
conf.writeEntry( "XOffset", m_ui->xOffsetSpin->value() );
conf.writeEntry( "YOffset", m_ui->yOffsetSpin->value() );
conf.writeEntry( "Opacity", m_ui->opacitySpin->value() / 100.0 );
conf.writeEntry( "Fuzzyness", m_ui->fuzzinessSpin->value() );
conf.writeEntry( "Size", m_ui->sizeSpin->value() );
QColor userColor = m_ui->colorButton->color();
if( userColor == schemeShadowColor() )
// If the user has reset the color to the default we want to start
// picking up color scheme changes again in the shadow effect
conf.deleteEntry( "Color" );
else
conf.writeEntry( "Color", userColor );
conf.writeEntry( "IntensifyActiveShadow", m_ui->strongerActiveBox->isChecked() );
conf.sync();
emit changed(false);
EffectsHandler::sendReloadMessage( "shadow" );
// We also need to reload decorations
QDBusMessage message = QDBusMessage::createMethodCall( "org.kde.kwin", "/KWin", "org.kde.KWin", "reconfigure" );
QDBusConnection::sessionBus().send( message );
}
void ShadowEffectConfig::defaults()
{
m_ui->xOffsetSpin->setValue( 0 );
m_ui->yOffsetSpin->setValue( 3 );
m_ui->opacitySpin->setValue( 25 );
m_ui->fuzzinessSpin->setValue( 10 );
m_ui->sizeSpin->setValue( 5 );
m_ui->colorButton->setColor( schemeShadowColor() );
m_ui->strongerActiveBox->setChecked( true );
emit changed(true);
}
} // namespace
#include "shadow_config.moc"
[Desktop Entry]
Type=Service
X-KDE-ServiceTypes=KCModule
X-KDE-Library=kcm_kwin4_effect_builtins
X-KDE-ParentComponents=kwin4_effect_shadow
X-KDE-PluginKeyword=shadow
Name=Shadow
Name[af]=Skaduwee
Name[ar]=ظل
Name[ast]=Solombra
Name[be]=Цень
Name[be@latin]=Cień
Name[bg]=Сянка
Name[bn]=ছায়া
Name[bn_IN]=ছায়া
Name[ca]=Ombra
Name[ca@valencia]=Ombra
Name[cs]=Stín
Name[csb]=Ceniô
Name[da]=Skygge
Name[de]=Schatten
Name[el]=Σκιά
Name[en_GB]=Shadow
Name[eo]=Ombro
Name[es]=Sombra
Name[et]=Vari
Name[eu]=Itzala
Name[fa]=سایه
Name[fi]=Varjo
Name[fr]=Ombre
Name[fy]=Skaad
Name[ga]=Scáth
Name[gl]=Sombra
Name[gu]=પડછાયો
Name[he]=צל
Name[hi]=छाया
Name[hne]=छइंहा
Name[hr]=Sjena
Name[hu]=Árnyékolt ablakok
Name[ia]=Umbra
Name[id]=Bayang
Name[is]=Skuggi
Name[it]=Ombra
Name[ja]=影付け
Name[kk]=Көлеңке
Name[km]=ស្រមោល​
Name[kn]=ನೆರಳು
Name[ko]=그림자
Name[ku]=Sî
Name[lt]=Šešėlis
Name[lv]=Ēna
Name[mai]=छाया
Name[mk]=Сенка
Name[ml]=നിഴല്‍
Name[mr]=छायाकृती
Name[nb]=Skyggelegg
Name[nds]=Schadden
Name[ne]=छायाँ
Name[nl]=Schaduw
Name[nn]=Vindaugsskuggar
Name[oc]=Ombra
Name[pa]=ਛਾਂ
Name[pl]=Cień
Name[pt]=Sombra
Name[pt_BR]=Sombra
Name[ro]=Umbră
Name[ru]=Тень
Name[se]=Suoivvanastte
Name[si]=සෙවණැල්ල
Name[sk]=Tieň
Name[sl]=Senca
Name[sr]=Сенка
Name[sr@ijekavian]=Сијенка
Name[sr@ijekavianlatin]=Sijenka
Name[sr@latin]=Senka
Name[sv]=Skugga
Name[ta]=நிழல்
Name[te]=నీ‍డ
Name[tg]=Соя
Name[th]=เงา
Name[tr]=Gölge
Name[uk]=Тінь
Name[uz]=Soya
Name[uz@cyrillic]=Соя
Name[vi]=Bóng
Name[wa]=Ombion
Name[x-test]=xxShadowxx
Name[zh_CN]=阴影
Name[zh_TW]=陰影
/********************************************************************
KWin - the KDE window manager
This file is part of the KDE project.
Copyright (C) 2007 Rivo Laks <rivolaks@hot.ee>
Copyright (C) 2008 Lucas Murray <lmurray@undefinedfire.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/
#ifndef KWIN_SHADOW_CONFIG_H
#define KWIN_SHADOW_CONFIG_H
#include <kcmodule.h>
#include "ui_shadow_config.h"
namespace KWin
{
class ShadowEffectConfigForm : public QWidget, public Ui::ShadowEffectConfigForm
{
Q_OBJECT
public:
explicit ShadowEffectConfigForm(QWidget* parent);
};
class ShadowEffectConfig : public KCModule
{
Q_OBJECT
public:
explicit ShadowEffectConfig(QWidget* parent = 0, const QVariantList& args = QVariantList());
~ShadowEffectConfig();
public slots:
virtual void save();
virtual void load();
virtual void defaults();
private:
ShadowEffectConfigForm* m_ui;
};
} // namespace
#endif
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>KWin::ShadowEffectConfigForm</class>
<widget class="QWidget" name="KWin::ShadowEffectConfigForm">
<property name="geometry">
<rect>