[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: =?utf-8?q?=5Bkde-workspace/graesslin/kwin-cleanup=5D_kwin/=3A_Re?=
From: Martin_Gräßlin <kde () martin-graesslin ! com>
Date: 2011-01-31 21:04:40
Message-ID: 20110131210440.87085A60D2 () git ! kde ! org
[Download RAW message or body]
Git commit 3b8984d630cc6dc655a171fa9c0f7e74e9ee3c61 by Martin Gräßlin.
Pushed by graesslin into branch 'graesslin/kwin-cleanup'.
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
M +0 -1 kwin/effects/CMakeLists.txt
M +0 -7 kwin/effects/configs_builtins.cpp
D +0 -31 kwin/effects/shadow/CMakeLists.txt
D +0 -786 kwin/effects/shadow/shadow.cpp
D +0 -166 kwin/effects/shadow/shadow.desktop [TRAILING SPACE] [TRAILING \
SPACE] D +0 -102 kwin/effects/shadow/shadow.h
D +0 -128 kwin/effects/shadow/shadow_config.cpp
D +0 -91 kwin/effects/shadow/shadow_config.desktop
D +0 -57 kwin/effects/shadow/shadow_config.h
D +0 -258 kwin/effects/shadow/shadow_config.ui
D +0 -70 kwin/effects/shadow/shadow_helper.h
M +0 -4 kwin/kcmkwin/kwincompositing/main.cpp
M +9 -20 kwin/kcmkwin/kwincompositing/main.ui
http://commits.kde.org/a5d5b61a/3b8984d630cc6dc655a171fa9c0f7e74e9ee3c61
diff --git a/kwin/effects/CMakeLists.txt b/kwin/effects/CMakeLists.txt
index 28618d2..c7a5d72 100644
--- a/kwin/effects/CMakeLists.txt
+++ b/kwin/effects/CMakeLists.txt
@@ -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
diff --git a/kwin/effects/configs_builtins.cpp b/kwin/effects/configs_builtins.cpp
index b5d4a6d..d80d3ad 100644
--- a/kwin/effects/configs_builtins.cpp
+++ b/kwin/effects/configs_builtins.cpp
@@ -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 )
diff --git a/kwin/effects/shadow/CMakeLists.txt b/kwin/effects/shadow/CMakeLists.txt
deleted file mode 100644
index e7e3413..0000000
--- a/kwin/effects/shadow/CMakeLists.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-#######################################
-# 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 )
diff --git a/kwin/effects/shadow/data/shadow-texture.png \
b/kwin/effects/shadow/data/shadow-texture.png deleted file mode 100644
index e5127c1..0000000
Binary files a/kwin/effects/shadow/data/shadow-texture.png and /dev/null differ
diff --git a/kwin/effects/shadow/shadow.cpp b/kwin/effects/shadow/shadow.cpp
deleted file mode 100644
index 43acd52..0000000
--- a/kwin/effects/shadow/shadow.cpp
+++ /dev/null
@@ -1,786 +0,0 @@
-/********************************************************************
- 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/>.
-*********************************************************************/
-
-#include "shadow.h"
-#include "shadow_helper.h"
-
-#include <kwinglutils.h>
-
-#include <kconfiggroup.h>
-#include <kdebug.h>
-#include <KStandardDirs>
-#include <kcolorscheme.h>
-#include <KGlobalSettings>
-
-#include <cmath>
-
-namespace KWin
-{
-
-KWIN_EFFECT( shadow, ShadowEffect )
-
-enum {
- ShadowOverrideRole = 0x22A982D1
-};
-
-ShadowEffect::ShadowEffect()
- : shadowSize( 0 )
- {
- cachedBlendPicture = X::None;
- reconfigure( ReconfigureAll );
- connect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()),
- this, SLOT(updateShadowColor()));
- shadowOverride = XInternAtom( display(), "_KDE_SHADOW_OVERRIDE", False );
- effects->registerPropertyType( shadowOverride, true );
- }
-
-ShadowEffect::~ShadowEffect()
- {
-#ifdef KWIN_HAVE_OPENGL_COMPOSITING
- for( int i = 0; i < mDefaultShadowTextures.size(); i++ )
- delete mDefaultShadowTextures.at( i );
-#endif
-#ifdef KWIN_HAVE_XRENDER_COMPOSITING
- for( int i = 0; i < mDefaultShadowPics.size(); i++ )
- delete mDefaultShadowPics.at( i );
-#endif
- effects->registerPropertyType( shadowOverride, false );
- }
-
-void ShadowEffect::reconfigure( ReconfigureFlags )
- {
- KConfigGroup conf = effects->effectConfig("Shadow");
- shadowXOffset = conf.readEntry( "XOffset", 0 );
- shadowYOffset = conf.readEntry( "YOffset", 3 );
- shadowOpacity = conf.readEntry( "Opacity", 0.25 );
- shadowFuzzyness = conf.readEntry( "Fuzzyness", 10 );
- shadowSize = conf.readEntry( "Size", 5 );
- intensifyActiveShadow = conf.readEntry( "IntensifyActiveShadow", true );
- updateShadowColor();
-
- // Load decoration shadow related things
-#ifdef KWIN_HAVE_OPENGL_COMPOSITING
- if( effects->compositingType() == OpenGLCompositing )
- {
- // Delete any other textures in memory
- for( int i = 0; i < mDefaultShadowTextures.size(); i++ )
- delete mDefaultShadowTextures.at( i );
- mDefaultShadowTextures.clear();
-
- //-------------------------
- // Create default textures
-
- mDefaultShadowQuadType = effects->newWindowQuadType(); // TODO: Unregister?
- QImage shadowImageSrc( KGlobal::dirs()->findResource( "data", \
"kwin/shadow-texture.png" ));
-
- // Might as well process the shadow color here
- QImage shadowImage( shadowImageSrc.width(), shadowImageSrc.height(), \
QImage::Format_ARGB32 );
- QPainter painter( &shadowImage );
- //painter.setCompositionMode( QPainter::CompositionMode_Multiply );
- painter.setPen( Qt::NoPen );
- painter.setBrush( shadowColor );
- painter.drawRect( 0, 0, shadowImage.width(), shadowImage.height() );
- painter.end();
- shadowImage.setAlphaChannel( shadowImageSrc.alphaChannel() ); // Cheat, just \
use the alpha mask
-
- int hw = shadowImage.width() / 2;
- int hh = shadowImage.height() / 2;
- mDefaultShadowTextures.append( new GLTexture( shadowImage.copy( 0, 0, hw, \
hh )));
- mDefaultShadowTextures.append( new GLTexture( shadowImage.copy( hw, 0, 1, \
hh )));
- mDefaultShadowTextures.append( new GLTexture( shadowImage.copy( hw, 0, hw, \
hh )));
- mDefaultShadowTextures.append( new GLTexture( shadowImage.copy( 0, hh, hw, \
1 )));
- mDefaultShadowTextures.append( new GLTexture( shadowImage.copy( hw, hh, 1, \
1 )));
- mDefaultShadowTextures.append( new GLTexture( shadowImage.copy( hw, hh, hw, \
1 )));
- mDefaultShadowTextures.append( new GLTexture( shadowImage.copy( 0, hh, hw, \
hh )));
- mDefaultShadowTextures.append( new GLTexture( shadowImage.copy( hw, hh, 1, \
hh )));
- mDefaultShadowTextures.append( new GLTexture( shadowImage.copy( hw, hh, hw, \
hh )));
- }
-#endif
-#ifdef KWIN_HAVE_XRENDER_COMPOSITING
- if( effects->compositingType() == XRenderCompositing )
- {
- // Delete any other pictures in memory
- for( int i = 0; i < mDefaultShadowPics.size(); i++ )
- delete mDefaultShadowPics.at( i );
- mDefaultShadowPics.clear();
-
- // Create default pictures
- mDefaultShadowQuadType = effects->newWindowQuadType(); // TODO: Unregister?
- QPixmap shadowPixmap( KGlobal::dirs()->findResource( "data", \
"kwin/shadow-texture.png" ));
- shadowPixmap = shadowPixmap.scaled( QSize( shadowFuzzyness * 4, \
shadowFuzzyness * 4 ),
- Qt::IgnoreAspectRatio, Qt::SmoothTransformation );
- int hw = shadowPixmap.width() / 2;
- int hh = shadowPixmap.height() / 2;
- mDefaultShadowPics.append( new XRenderPicture( shadowPixmap.copy( 0, 0, \
hw, hh )));
- mDefaultShadowPics.append( new XRenderPicture( shadowPixmap.copy( hw, 0, 1, \
hh )));
- mDefaultShadowPics.append( new XRenderPicture( shadowPixmap.copy( hw, 0, \
hw, hh )));
- mDefaultShadowPics.append( new XRenderPicture( shadowPixmap.copy( 0, hh, \
hw, 1 )));
- mDefaultShadowPics.append( new XRenderPicture( shadowPixmap.copy( hw, hh, 1, \
1 )));
- mDefaultShadowPics.append( new XRenderPicture( shadowPixmap.copy( hw, hh, \
hw, 1 )));
- mDefaultShadowPics.append( new XRenderPicture( shadowPixmap.copy( 0, hh, \
hw, hh )));
- mDefaultShadowPics.append( new XRenderPicture( shadowPixmap.copy( hw, hh, 1, \
hh )));
- mDefaultShadowPics.append( new XRenderPicture( shadowPixmap.copy( hw, hh, \
hw, hh )));
-
- // Apply repeat attribute to all pictures
- XRenderPictureAttributes pa;
- pa.repeat = true;
- for( int i = 0; i < mDefaultShadowPics.size(); i++ )
- XRenderChangePicture( display(), *mDefaultShadowPics.at( i ), CPRepeat, \
&pa );
- }
-#endif
-
- // Force rebuild of all quads to clear their caches
- foreach( EffectWindow *w, effects->stackingOrder() )
- if( w ) // TODO/HACK: stackingOrder() should NOT return NULL
- w->buildQuads( true );
- }
-
-void ShadowEffect::updateShadowColor()
- {
- KConfigGroup conf = effects->effectConfig("Shadow");
- shadowColor = conf.readEntry( "Color", schemeShadowColor() );
- }
-
-QRect ShadowEffect::shadowRectangle( EffectWindow* w, const QRect& windowRectangle ) \
const
- {
- Q_UNUSED( w );
- int shadowGrow = shadowFuzzyness + shadowSize;
- return windowRectangle.adjusted( shadowXOffset - shadowGrow, shadowYOffset - \
shadowGrow,
- shadowXOffset + shadowGrow, shadowYOffset + shadowGrow);
- }
-
-#ifdef KWIN_HAVE_XRENDER_COMPOSITING
-static ScreenPaintData gScreenData;
-#endif
-
-void ShadowEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data )
- {
- shadowDatas.clear();
-#ifdef KWIN_HAVE_XRENDER_COMPOSITING
- if ((mask & PAINT_SCREEN_TRANSFORMED) &&
- (effects->compositingType() == XRenderCompositing)) // TODO: copy \
constructor?
- {
- gScreenData.xTranslate = data.xTranslate;
- gScreenData.yTranslate = data.yTranslate;
- gScreenData.xScale = data.xScale;
- gScreenData.yScale = data.yScale;
- }
-#endif
- // Draw windows
- effects->paintScreen( mask, region, data );
-
- // Draw shadows
- drawQueuedShadows( 0 );
- }
-
-void ShadowEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& data, int \
time )
- {
- if( useShadow( w ))
- data.paint |= shadowRectangle( w, data.paint.boundingRect() );
- effects->prePaintWindow( w, data, time );
- }
-
-void ShadowEffect::drawWindow( EffectWindow* w, int mask, QRegion region, \
WindowPaintData& data )
- {
- // Whether the shadow drawing can be delayed or not.
- bool optimize = !(mask & ( PAINT_WINDOW_TRANSFORMED | PAINT_SCREEN_TRANSFORMED |
- PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS | PAINT_WINDOW_TRANSLUCENT | \
PAINT_DECORATION_ONLY ));
-
- QRegion rgn = region;
- if ( w->keepAbove() )
- {
- QRegion shape = w->shape().translated( w->x(), w->y());
- if (optimize)
- {
- rgn -= shape;
- QList<ShadowData>::iterator i;
- for( i = shadowDatas.begin(); i != shadowDatas.end(); ++i )
- (*i).clip |= shape;
- }
- optimize = false;
- }
- if( !optimize )
- {
- // Transformed or translucent windows are drawn bottom-to-top, so
- // first we need to draw all queued shadows.
- drawQueuedShadows( w );
- }
- if( useShadow( w ) && (!(mask & PAINT_DECORATION_ONLY) || w->keepAbove()) )
- {
- if( !optimize )
- {
- // For translucent windows, shadow needs to be drawn before the
- // window itself.
- drawShadow( w, mask, rgn, data );
- }
- else
- {
- // For opaque windows, just schedule the shadow to be drawn later
- ShadowData d(w, data);
- d.clip = w->shape().translated( w->x(), w->y());
- if( !shadowDatas.isEmpty())
- d.clip |= shadowDatas.last().clip;
- d.mask = mask;
- foreach( const QRect &r, region.rects() )
- d.region |= shadowRectangle( w, r );
- d.region &= region;
- shadowDatas.append(d);
- }
- }
-
- effects->drawWindow( w, mask, region, data );
- }
-
-void ShadowEffect::buildQuads( EffectWindow* w, WindowQuadList& quadList )
- {
- // TODO: add config option to not have shadows for menus, etc.
- // Make our own shadow as the decoration doesn't support it
- int fuzzy = shadowFuzzyness;
- // Shadow's size must be a least 2*fuzzy in both directions (or the corners will \
be broken)
- int width = qMax( fuzzy * 2, w->width() + 2 * shadowSize );
- int height = qMax( fuzzy * 2, w->height() + 2 * shadowSize );
- double x1, y1, x2, y2;
- int id = 0;
- // top-left
- x1 = shadowXOffset - shadowSize + 0 - fuzzy;
- y1 = shadowYOffset - shadowSize + 0 - fuzzy;
- x2 = shadowXOffset - shadowSize + 0 + fuzzy;
- y2 = shadowYOffset - shadowSize + 0 + fuzzy;
- WindowQuad topLeftQuad( mDefaultShadowQuadType, id++ );
- topLeftQuad[ 0 ] = WindowVertex( x1, y1, 0, 1 );
- topLeftQuad[ 1 ] = WindowVertex( x2, y1, 1, 1 );
- topLeftQuad[ 2 ] = WindowVertex( x2, y2, 1, 0 );
- topLeftQuad[ 3 ] = WindowVertex( x1, y2, 0, 0 );
- quadList.append( topLeftQuad );
- // top
- x1 = shadowXOffset - shadowSize + 0 + fuzzy;
- y1 = shadowYOffset - shadowSize + 0 - fuzzy;
- x2 = shadowXOffset - shadowSize + width - fuzzy;
- y2 = shadowYOffset - shadowSize + 0 + fuzzy;
- WindowQuad topQuad( mDefaultShadowQuadType, id++ );
- topQuad[ 0 ] = WindowVertex( x1, y1, 0, 1 );
- topQuad[ 1 ] = WindowVertex( x2, y1, 1, 1 );
- topQuad[ 2 ] = WindowVertex( x2, y2, 1, 0 );
- topQuad[ 3 ] = WindowVertex( x1, y2, 0, 0 );
- quadList.append( topQuad );
- // top-right
- x1 = shadowXOffset - shadowSize + width - fuzzy;
- y1 = shadowYOffset - shadowSize + 0 - fuzzy;
- x2 = shadowXOffset - shadowSize + width + fuzzy;
- y2 = shadowYOffset - shadowSize + 0 + fuzzy;
- WindowQuad topRightQuad( mDefaultShadowQuadType, id++ );
- topRightQuad[ 0 ] = WindowVertex( x1, y1, 0, 1 );
- topRightQuad[ 1 ] = WindowVertex( x2, y1, 1, 1 );
- topRightQuad[ 2 ] = WindowVertex( x2, y2, 1, 0 );
- topRightQuad[ 3 ] = WindowVertex( x1, y2, 0, 0 );
- quadList.append( topRightQuad );
- // left
- x1 = shadowXOffset - shadowSize + 0 - fuzzy;
- y1 = shadowYOffset - shadowSize + 0 + fuzzy;
- x2 = shadowXOffset - shadowSize + 0 + fuzzy;
- y2 = shadowYOffset - shadowSize + height - fuzzy;
- WindowQuad leftQuad( mDefaultShadowQuadType, id++ );
- leftQuad[ 0 ] = WindowVertex( x1, y1, 0, 1 );
- leftQuad[ 1 ] = WindowVertex( x2, y1, 1, 1 );
- leftQuad[ 2 ] = WindowVertex( x2, y2, 1, 0 );
- leftQuad[ 3 ] = WindowVertex( x1, y2, 0, 0 );
- quadList.append( leftQuad );
- // center
- x1 = shadowXOffset - shadowSize + 0 + fuzzy;
- y1 = shadowYOffset - shadowSize + 0 + fuzzy;
- x2 = shadowXOffset - shadowSize + width - fuzzy;
- y2 = shadowYOffset - shadowSize + height - fuzzy;
- WindowQuad contentsQuad( mDefaultShadowQuadType, id++ );
- contentsQuad[ 0 ] = WindowVertex( x1, y1, 0, 1 );
- contentsQuad[ 1 ] = WindowVertex( x2, y1, 1, 1 );
- contentsQuad[ 2 ] = WindowVertex( x2, y2, 1, 0 );
- contentsQuad[ 3 ] = WindowVertex( x1, y2, 0, 0 );
- quadList.append( contentsQuad );
- // right
- x1 = shadowXOffset - shadowSize + width - fuzzy;
- y1 = shadowYOffset - shadowSize + 0 + fuzzy;
- x2 = shadowXOffset - shadowSize + width + fuzzy;
- y2 = shadowYOffset - shadowSize + height - fuzzy;
- WindowQuad rightQuad( mDefaultShadowQuadType, id++ );
- rightQuad[ 0 ] = WindowVertex( x1, y1, 0, 1 );
- rightQuad[ 1 ] = WindowVertex( x2, y1, 1, 1 );
- rightQuad[ 2 ] = WindowVertex( x2, y2, 1, 0 );
- rightQuad[ 3 ] = WindowVertex( x1, y2, 0, 0 );
- quadList.append( rightQuad );
- // bottom-left
- x1 = shadowXOffset - shadowSize + 0 - fuzzy;
- y1 = shadowYOffset - shadowSize + height - fuzzy;
- x2 = shadowXOffset - shadowSize + 0 + fuzzy;
- y2 = shadowYOffset - shadowSize + height + fuzzy;
- WindowQuad bottomLeftQuad( mDefaultShadowQuadType, id++ );
- bottomLeftQuad[ 0 ] = WindowVertex( x1, y1, 0, 1 );
- bottomLeftQuad[ 1 ] = WindowVertex( x2, y1, 1, 1 );
- bottomLeftQuad[ 2 ] = WindowVertex( x2, y2, 1, 0 );
- bottomLeftQuad[ 3 ] = WindowVertex( x1, y2, 0, 0 );
- quadList.append( bottomLeftQuad );
- // bottom
- x1 = shadowXOffset - shadowSize + 0 + fuzzy;
- y1 = shadowYOffset - shadowSize + height - fuzzy;
- x2 = shadowXOffset - shadowSize + width - fuzzy;
- y2 = shadowYOffset - shadowSize + height + fuzzy;
- WindowQuad bottomQuad( mDefaultShadowQuadType, id++ );
- bottomQuad[ 0 ] = WindowVertex( x1, y1, 0, 1 );
- bottomQuad[ 1 ] = WindowVertex( x2, y1, 1, 1 );
- bottomQuad[ 2 ] = WindowVertex( x2, y2, 1, 0 );
- bottomQuad[ 3 ] = WindowVertex( x1, y2, 0, 0 );
- quadList.append( bottomQuad );
- // bottom-right
- x1 = shadowXOffset - shadowSize + width - fuzzy;
- y1 = shadowYOffset - shadowSize + height - fuzzy;
- x2 = shadowXOffset - shadowSize + width + fuzzy;
- y2 = shadowYOffset - shadowSize + height + fuzzy;
- WindowQuad bottomRightQuad( mDefaultShadowQuadType, id++ );
- bottomRightQuad[ 0 ] = WindowVertex( x1, y1, 0, 1 );
- bottomRightQuad[ 1 ] = WindowVertex( x2, y1, 1, 1 );
- bottomRightQuad[ 2 ] = WindowVertex( x2, y2, 1, 0 );
- bottomRightQuad[ 3 ] = WindowVertex( x1, y2, 0, 0 );
- quadList.append( bottomRightQuad );
-
- effects->buildQuads( w, quadList );
- }
-
-QRect ShadowEffect::transformWindowDamage( EffectWindow* w, const QRect& r )
- {
- if( !useShadow( w ))
- return effects->transformWindowDamage( w, r );
- QRect r2 = r | shadowRectangle( w, r );
- return effects->transformWindowDamage( w, r2 );
- }
-
-void ShadowEffect::propertyNotify( EffectWindow* w, long atom )
- {
- if( !w || atom != shadowOverride )
- return;
- const QByteArray value = w->readProperty( atom, atom, 32 );
- w->setData( ShadowOverrideRole, !value.isNull() );
- effects->addRepaint( shadowRectangle( w, w->geometry() ));
- }
-
-void ShadowEffect::windowAdded( EffectWindow* c )
- {
- const QByteArray value = c->readProperty( shadowOverride, shadowOverride, 32 );
- c->setData( ShadowOverrideRole, !value.isNull() );
- }
-
-void ShadowEffect::windowClosed( EffectWindow* c )
- {
- effects->addRepaint( shadowRectangle( c, c->geometry() ));
- }
-
-bool ShadowEffect::useShadow( EffectWindow* w ) const
- {
- return !w->isDeleted() && !w->isDesktop() && !w->isDock()
- // popups may have shadow even if shaped, their shape is almost rectangular
- && ( !w->hasOwnShape() || w->isDropdownMenu() || w->isPopupMenu() || \
w->isComboBox())
- // Ignore windows that draw their own shadows
- && !w->data( ShadowOverrideRole ).toBool()
- // If decoration has it's own shadow leave it alone
- && !( w->hasDecoration() && effects->hasDecorationShadows() )
- && !( w->windowClass() == "ksmserver ksmserver" &&
- ( w->windowRole() == "logoutdialog" || w->windowRole() == \
"logouteffect" ));
- }
-
-void ShadowEffect::addQuadVertices(QVector<float>& verts, float x1, float y1, float \
x2, float y2) const
- {
- verts << x1 << y1;
- verts << x1 << y2;
- verts << x2 << y2;
- verts << x2 << y1;
- }
-
-void ShadowEffect::drawQueuedShadows( EffectWindow* behindWindow )
- {
- QList<ShadowData> newShadowDatas;
- QList<ShadowData> thisTime;
- EffectWindowList stack = effects->stackingOrder();
- foreach( const ShadowData &d, shadowDatas )
- {
- // If behindWindow is given then only render shadows of the windows
- // that are behind that window.
- if( !behindWindow || stack.indexOf(d.w) < stack.indexOf(behindWindow))
- thisTime.append(d);
- else
- newShadowDatas.append(d);
- }
- if( thisTime.count() )
- { // Render them in stacking order
- foreach( EffectWindow *w, stack )
- for( int i = 0; i < thisTime.size(); i++ )
- { // Cannot use foreach() due to thisTime.removeOne()
- const ShadowData d = thisTime.at(i);
- if( d.w == w )
- {
- drawShadow( d.w, d.mask,
- d.region.subtracted( d.clip ), d.data );
- thisTime.removeAt( i );
- break;
- }
- }
- }
- // Render the rest on the top (For menus, etc.)
- foreach( const ShadowData &d, thisTime )
- drawShadow( d.w, d.mask, d.region.subtracted( d.clip ), d.data );
- shadowDatas = newShadowDatas;
- }
-
-// Modified version of SceneOpenGL::Window::prepareRenderStates() from \
scene_opengl.cpp
-void ShadowEffect::prepareRenderStates( GLTexture *texture, double opacity, double \
brightness, double saturation )
- {
- Q_UNUSED( texture );
- Q_UNUSED( saturation );
-#ifdef KWIN_HAVE_OPENGL_COMPOSITING
- // setup blending of transparent windows
- glPushAttrib( GL_ENABLE_BIT );
- /*if( saturation != 1.0 && texture->saturationSupported() )
- {
- // First we need to get the color from [0; 1] range to [0.5; 1] range
- glActiveTexture( GL_TEXTURE0 );
- glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE );
- glTexEnvi( GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_INTERPOLATE );
- glTexEnvi( GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_TEXTURE );
- glTexEnvi( GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR );
- glTexEnvi( GL_TEXTURE_ENV, GL_SOURCE1_RGB, GL_CONSTANT );
- glTexEnvi( GL_TEXTURE_ENV, GL_OPERAND1_RGB, GL_SRC_COLOR );
- glTexEnvi( GL_TEXTURE_ENV, GL_SOURCE2_RGB, GL_CONSTANT );
- glTexEnvi( GL_TEXTURE_ENV, GL_OPERAND2_RGB, GL_SRC_ALPHA );
- const float scale_constant[] = { 1.0, 1.0, 1.0, 0.5 };
- glTexEnvfv( GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, scale_constant );
- texture->bind();
-
- // Then we take dot product of the result of previous pass and
- // saturation_constant. This gives us completely unsaturated
- // (greyscale) image
- // Note that both operands have to be in range [0.5; 1] since opengl
- // automatically substracts 0.5 from them
- glActiveTexture( GL_TEXTURE1 );
- float saturation_constant[] = { 0.5 + 0.5*0.30, 0.5 + 0.5*0.59, 0.5 + \
0.5*0.11, saturation };
- glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE );
- glTexEnvi( GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_DOT3_RGB );
- glTexEnvi( GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_PREVIOUS );
- glTexEnvi( GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR );
- glTexEnvi( GL_TEXTURE_ENV, GL_SOURCE1_RGB, GL_CONSTANT );
- glTexEnvi( GL_TEXTURE_ENV, GL_OPERAND1_RGB, GL_SRC_COLOR );
- glTexEnvfv( GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, saturation_constant );
- texture->bind();
-
- // Finally we need to interpolate between the original image and the
- // greyscale image to get wanted level of saturation
- glActiveTexture( GL_TEXTURE2 );
- glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE );
- glTexEnvi( GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_INTERPOLATE );
- glTexEnvi( GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_TEXTURE0 );
- glTexEnvi( GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR );
- glTexEnvi( GL_TEXTURE_ENV, GL_SOURCE1_RGB, GL_PREVIOUS );
- glTexEnvi( GL_TEXTURE_ENV, GL_OPERAND1_RGB, GL_SRC_COLOR );
- glTexEnvi( GL_TEXTURE_ENV, GL_SOURCE2_RGB, GL_CONSTANT );
- glTexEnvi( GL_TEXTURE_ENV, GL_OPERAND2_RGB, GL_SRC_ALPHA );
- glTexEnvfv( GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, saturation_constant );
- // Also replace alpha by primary color's alpha here
- glTexEnvi( GL_TEXTURE_ENV, GL_COMBINE_ALPHA, GL_REPLACE );
- glTexEnvi( GL_TEXTURE_ENV, GL_SOURCE0_ALPHA, GL_PRIMARY_COLOR );
- glTexEnvi( GL_TEXTURE_ENV, GL_OPERAND0_ALPHA, GL_SRC_ALPHA );
- // And make primary color contain the wanted opacity
- glColor4f( opacity, opacity, opacity, opacity );
- texture->bind();
-
- if( brightness != 1.0 )
- {
- glActiveTexture( GL_TEXTURE3 );
- glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE );
- glTexEnvi( GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_MODULATE );
- glTexEnvi( GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_PREVIOUS );
- glTexEnvi( GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR );
- glTexEnvi( GL_TEXTURE_ENV, GL_SOURCE1_RGB, GL_PRIMARY_COLOR );
- glTexEnvi( GL_TEXTURE_ENV, GL_OPERAND1_RGB, GL_SRC_COLOR );
- // The color has to be multiplied by both opacity and brightness
- float opacityByBrightness = opacity * brightness;
- glColor4f( opacityByBrightness, opacityByBrightness, \
opacityByBrightness, opacity );
- glTexEnvi( GL_TEXTURE_ENV, GL_COMBINE_ALPHA, GL_REPLACE );
- glTexEnvi( GL_TEXTURE_ENV, GL_SOURCE0_ALPHA, GL_PREVIOUS );
- glTexEnvi( GL_TEXTURE_ENV, GL_OPERAND0_ALPHA, GL_SRC_ALPHA );
- texture->bind();
- }
-
- glActiveTexture(GL_TEXTURE0 );
- }
- else*/ if( opacity != 1.0 || brightness != 1.0 )
- { // The window is additionally configured to have its opacity adjusted
- glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
- glColor4f( brightness, brightness, brightness, opacity );
- }
-#endif
- }
-
-// Modified version of SceneOpenGL::Window::restoreRenderStates() from \
scene_opengl.cpp
-void ShadowEffect::restoreRenderStates( GLTexture *texture, double opacity, double \
brightness, double saturation )
- {
- Q_UNUSED( texture );
-#ifdef KWIN_HAVE_OPENGL_COMPOSITING
- if( opacity != 1.0 || saturation != 1.0 || brightness != 1.0 )
- {
- /*if( saturation != 1.0 && texture->saturationSupported())
- {
- glActiveTexture(GL_TEXTURE3);
- glDisable( texture->target() );
- glActiveTexture(GL_TEXTURE2);
- glDisable( texture->target() );
- glActiveTexture(GL_TEXTURE1);
- glDisable( texture->target() );
- glActiveTexture(GL_TEXTURE0);
- }*/
- glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE );
- glColor4f( 0.0, 0.0, 0.0, 0.0 );
- }
-
- glPopAttrib(); // ENABLE_BIT
-#endif
- }
-
-void ShadowEffect::drawShadowQuadOpenGL( GLTexture *texture, QVector<float> verts, \
QVector<float> texCoords,
- QRegion region, float opacity, float brightness, float saturation, GLShader* \
shader )
- {
-#ifdef KWIN_HAVE_OPENGL_COMPOSITING
- glColor4f( 1.0, 1.0, 1.0, 1.0 );
- glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE );
- prepareRenderStates( texture, opacity, brightness, saturation ); // Usually \
overrides the above
- if( shader )
- {
- shader->setUniform("opacity", opacity);
- shader->setUniform("saturation", saturation);
- shader->setUniform("brightness", brightness);
- shader->setUniform("textureWidth", 1.0f);
- shader->setUniform("textureHeight", 1.0f);
- }
- texture->bind();
- texture->enableNormalizedTexCoords();
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
- renderGLGeometry( region, 4, verts.data(), texCoords.data() );
- texture->disableNormalizedTexCoords();
- texture->unbind();
- restoreRenderStates( texture, opacity, brightness, saturation );
-#endif
- }
-
-void ShadowEffect::drawShadowQuadXRender( XRenderPicture *picture, QRect rect, float \
xScale, float yScale,
- QColor color, float opacity, float brightness, float saturation )
- {
- Q_UNUSED( saturation );
-#ifdef KWIN_HAVE_XRENDER_COMPOSITING
- XRenderPicture fill;
- if( color.isValid() )
- {
- if ( color == cachedColor && cachedBlendPicture != X::None )
- fill = cachedBlendPicture;
- else
- {
- XRenderColor xc = preMultiply( color, opacity );
- cachedBlendPicture = fill = xRenderFill( &xc );
- cachedColor = color;
- }
- }
- else
- fill = xRenderBlendPicture(opacity);
-
- // Scale if required
- if( xScale != 1.0 || yScale != 1.0 )
- {
- XTransform xform = {{
- { XDoubleToFixed( 1.0 / xScale ), XDoubleToFixed( 0.0 ), XDoubleToFixed( \
0.0 ) },
- { XDoubleToFixed( 0.0 ), XDoubleToFixed( 1.0 / yScale ), XDoubleToFixed( \
0.0 ) },
- { XDoubleToFixed( 0.0 ), XDoubleToFixed( 0.0 ), XDoubleToFixed( 1.0 ) }
- }};
- XRenderSetPictureTransform( display(), *picture, &xform );
- }
-
- // Render it
- // TODO: This always uses the fast filter, detect when to use smooth instead
- if( color.isValid() )
- XRenderComposite( display(), PictOpOver, fill, *picture, \
effects->xrenderBufferPicture(), 0, 0, 0, 0,
- rect.x(), rect.y(), rect.width(), rect.height() );
- else
- XRenderComposite( display(), PictOpOver, *picture, fill, \
effects->xrenderBufferPicture(), 0, 0, 0, 0,
- rect.x(), rect.y(), rect.width(), rect.height() );
-
- // Fake brightness by overlaying black
- // Cannot use XRenderFillRectangle() due to ARGB
- fill = xRenderBlendPicture(( 1 - brightness ) * opacity);
- XRenderComposite( display(), PictOpOver, fill, *picture, \
effects->xrenderBufferPicture(), 0, 0, 0, 0,
- rect.x(), rect.y(), rect.width(), rect.height() );
-
- // Return to scale to 1.0
- if( xScale != 1.0 || yScale != 1.0 )
- {
- XTransform xform = {{
- { XDoubleToFixed( 1.0 ), XDoubleToFixed( 0.0 ), XDoubleToFixed( 0.0 ) },
- { XDoubleToFixed( 0.0 ), XDoubleToFixed( 1.0 ), XDoubleToFixed( 0.0 ) },
- { XDoubleToFixed( 0.0 ), XDoubleToFixed( 0.0 ), XDoubleToFixed( 1.0 ) }
- }};
- XRenderSetPictureTransform( display(), *picture, &xform );
- }
-#endif
- }
-
-void ShadowEffect::drawShadow( EffectWindow* window, int mask, QRegion region, const \
WindowPaintData& data )
- {
- // Don't allow windows to cast shadows on other displays
- QRegion clipperGeom;
- for( int screen = 0; screen < effects->numScreens(); screen++ )
- {
- QRect screenGeom = effects->clientArea( ScreenArea, screen, 0 );
- if( !( window->geometry() & screenGeom ).isNull() )
- clipperGeom |= screenGeom;
- }
- PaintClipper pc( clipperGeom );
-
-#ifdef KWIN_HAVE_OPENGL_COMPOSITING
- if( effects->compositingType() == OpenGLCompositing )
- {
- glPushAttrib( GL_CURRENT_BIT | GL_ENABLE_BIT | GL_TEXTURE_BIT );
- glEnable( GL_BLEND );
- glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
-
- foreach( const WindowQuad &quad, data.quads )
- {
- if( quad.type() != mDefaultShadowQuadType )
- continue; // Not a shadow quad
-
- glPushMatrix();
-
- // Use the window's top-left as the origin
- glTranslatef( window->x(), window->y(), 0 );
- if( mask & PAINT_WINDOW_TRANSFORMED )
- glTranslatef( data.xTranslate, data.yTranslate, data.zTranslate );
- if(( mask & PAINT_WINDOW_TRANSFORMED ) && ( data.xScale != 1 || \
data.yScale != 1 ))
- glScalef( data.xScale, data.yScale, data.zScale );
- if(( mask & PAINT_WINDOW_TRANSFORMED ) && data.rotation )
- {
- glTranslatef( data.rotation->xRotationPoint,
- data.rotation->yRotationPoint,
- data.rotation->zRotationPoint );
- float xAxis = 0.0;
- float yAxis = 0.0;
- float zAxis = 0.0;
- switch( data.rotation->axis )
- {
- case RotationData::XAxis:
- xAxis = 1.0;
- break;
- case RotationData::YAxis:
- yAxis = 1.0;
- break;
- case RotationData::ZAxis:
- zAxis = 1.0;
- break;
- }
- glRotatef( data.rotation->angle, xAxis, yAxis, zAxis );
- glTranslatef( -data.rotation->xRotationPoint,
- -data.rotation->yRotationPoint,
- -data.rotation->zRotationPoint );
- }
-
- // Create our polygon
- QVector<float> verts, texcoords;
- verts.reserve(8);
- texcoords.reserve(8);
- verts << quad[0].x() << quad[0].y();
- verts << quad[1].x() << quad[1].y();
- verts << quad[2].x() << quad[2].y();
- verts << quad[3].x() << quad[3].y();
- texcoords << quad[0].textureX() << quad[0].textureY();
- texcoords << quad[1].textureX() << quad[1].textureY();
- texcoords << quad[2].textureX() << quad[2].textureY();
- texcoords << quad[3].textureX() << quad[3].textureY();
-
- // Work out which texture to use
- float opacity = shadowOpacity;
- if( intensifyActiveShadow && window == effects->activeWindow() )
- opacity = 1 - ( 1 - shadowOpacity ) * ( 1 - shadowOpacity );
-
- drawShadowQuadOpenGL( mDefaultShadowTextures.at( quad.id() ),
- verts, texcoords, region,
- data.opacity * opacity,
- data.brightness,
- data.saturation,
- data.shader);
-
- glPopMatrix();
- }
-
- glPopAttrib();
- }
-#endif
-#ifdef KWIN_HAVE_XRENDER_COMPOSITING
- if( effects->compositingType() == XRenderCompositing )
- {
- XRenderSetPictureClipRegion( display(), effects->xrenderBufferPicture(), \
region.handle() );
-
- foreach( const WindowQuad &quad, data.quads )
- {
- if( quad.type() != mDefaultShadowQuadType )
- continue; // Not a shadow quad
-
- // Determine transformed quad position
- QRect windowRect = window->geometry();
- float xScale = 1.0;
- float yScale = 1.0;
- float xTranslate = 0.0;
- float yTranslate = 0.0;
- if( mask & PAINT_SCREEN_TRANSFORMED)
- {
- xScale = gScreenData.xScale;
- yScale = gScreenData.yScale;
- xTranslate += ( xScale - 1.0 ) * windowRect.x() + \
gScreenData.xTranslate;
- yTranslate += ( yScale - 1.0 ) * windowRect.y() + \
gScreenData.yTranslate;
- }
- if( mask & PAINT_WINDOW_TRANSFORMED)
- {
- xTranslate += xScale * data.xTranslate;
- yTranslate += yScale * data.yTranslate;
- xScale *= data.xScale;
- yScale *= data.yScale;
- }
- QRect quadRect(
- window->x() + quad[0].x() * xScale + xTranslate,
- window->y() + quad[0].y() * yScale + yTranslate,
- ( quad[2].x() - quad[0].x() ) * xScale,
- ( quad[2].y() - quad[0].y() ) * yScale );
-
- // Work out which texture to use
- float opacity = shadowOpacity;
- if( intensifyActiveShadow && window == effects->activeWindow() )
- opacity = 1 - ( 1 - shadowOpacity ) * ( 1 - shadowOpacity );
-
- drawShadowQuadXRender( mDefaultShadowPics.at( quad.id() ), quadRect, \
xScale, yScale,
- shadowColor, opacity * data.opacity, data.brightness, \
data.saturation );
- }
- }
-#endif
- }
-
-} // namespace
-
diff --git a/kwin/effects/shadow/shadow.desktop b/kwin/effects/shadow/shadow.desktop
deleted file mode 100644
index 2278bfa..0000000
--- a/kwin/effects/shadow/shadow.desktop
+++ /dev/null
@@ -1,166 +0,0 @@
-[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
diff --git a/kwin/effects/shadow/shadow.h b/kwin/effects/shadow/shadow.h
deleted file mode 100644
index a03bc14..0000000
--- a/kwin/effects/shadow/shadow.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/********************************************************************
- 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
diff --git a/kwin/effects/shadow/shadow_config.cpp \
b/kwin/effects/shadow/shadow_config.cpp deleted file mode 100644
index 5d4f834..0000000
--- a/kwin/effects/shadow/shadow_config.cpp
+++ /dev/null
@@ -1,128 +0,0 @@
-/********************************************************************
- 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"
diff --git a/kwin/effects/shadow/shadow_config.desktop \
b/kwin/effects/shadow/shadow_config.desktop deleted file mode 100644
index 01d2fd1..0000000
--- a/kwin/effects/shadow/shadow_config.desktop
+++ /dev/null
@@ -1,91 +0,0 @@
-[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]=陰影
diff --git a/kwin/effects/shadow/shadow_config.h \
b/kwin/effects/shadow/shadow_config.h deleted file mode 100644
index 4517f98..0000000
--- a/kwin/effects/shadow/shadow_config.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/********************************************************************
- 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
diff --git a/kwin/effects/shadow/shadow_config.ui \
b/kwin/effects/shadow/shadow_config.ui deleted file mode 100644
index b37d79f..0000000
--- a/kwin/effects/shadow/shadow_config.ui
+++ /dev/null
@@ -1,258 +0,0 @@
-<?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>
- <x>0</x>
- <y>0</y>
- <width>292</width>
- <height>219</height>
- </rect>
- </property>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <widget class="QLabel" name="label">
- <property name="text">
- <string>&X offset:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- <property name="buddy">
- <cstring>xOffsetSpin</cstring>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="KIntSpinBox" name="xOffsetSpin">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="specialValueText">
- <string/>
- </property>
- <property name="suffix">
- <string/>
- </property>
- <property name="minimum">
- <number>-100</number>
- </property>
- <property name="maximum">
- <number>100</number>
- </property>
- <property name="singleStep">
- <number>1</number>
- </property>
- <property name="value">
- <number>0</number>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_3">
- <property name="text">
- <string>&Y offset:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- <property name="buddy">
- <cstring>yOffsetSpin</cstring>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="KIntSpinBox" name="yOffsetSpin">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="specialValueText">
- <string/>
- </property>
- <property name="suffix">
- <string/>
- </property>
- <property name="minimum">
- <number>-100</number>
- </property>
- <property name="maximum">
- <number>100</number>
- </property>
- <property name="singleStep">
- <number>1</number>
- </property>
- <property name="value">
- <number>0</number>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="label_4">
- <property name="text">
- <string>&Opacity:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- <property name="buddy">
- <cstring>opacitySpin</cstring>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="KIntSpinBox" name="opacitySpin">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="specialValueText">
- <string/>
- </property>
- <property name="suffix">
- <string>%</string>
- </property>
- <property name="minimum">
- <number>0</number>
- </property>
- <property name="maximum">
- <number>100</number>
- </property>
- <property name="singleStep">
- <number>1</number>
- </property>
- <property name="value">
- <number>0</number>
- </property>
- </widget>
- </item>
- <item row="3" column="0">
- <widget class="QLabel" name="label_5">
- <property name="text">
- <string>&Fuzziness:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- <property name="buddy">
- <cstring>fuzzinessSpin</cstring>
- </property>
- </widget>
- </item>
- <item row="3" column="1">
- <widget class="KIntSpinBox" name="fuzzinessSpin">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="specialValueText">
- <string/>
- </property>
- <property name="suffix">
- <string/>
- </property>
- <property name="minimum">
- <number>0</number>
- </property>
- <property name="maximum">
- <number>100</number>
- </property>
- <property name="singleStep">
- <number>1</number>
- </property>
- <property name="value">
- <number>0</number>
- </property>
- </widget>
- </item>
- <item row="4" column="0">
- <widget class="QLabel" name="label_6">
- <property name="text">
- <string>&Size:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- <property name="buddy">
- <cstring>sizeSpin</cstring>
- </property>
- </widget>
- </item>
- <item row="4" column="1">
- <widget class="KIntSpinBox" name="sizeSpin">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="specialValueText">
- <string/>
- </property>
- <property name="suffix">
- <string/>
- </property>
- <property name="minimum">
- <number>0</number>
- </property>
- <property name="maximum">
- <number>100</number>
- </property>
- <property name="singleStep">
- <number>1</number>
- </property>
- <property name="value">
- <number>0</number>
- </property>
- </widget>
- </item>
- <item row="5" column="0">
- <widget class="QLabel" name="label_7">
- <property name="text">
- <string>&Color:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- <property name="buddy">
- <cstring>colorButton</cstring>
- </property>
- </widget>
- </item>
- <item row="5" column="1">
- <widget class="KColorButton" name="colorButton"/>
- </item>
- <item row="6" column="0" colspan="2">
- <widget class="QCheckBox" name="strongerActiveBox">
- <property name="text">
- <string>&Active windows have stronger shadows</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <customwidgets>
- <customwidget>
- <class>KColorButton</class>
- <extends>QPushButton</extends>
- <header>kcolorbutton.h</header>
- </customwidget>
- <customwidget>
- <class>KIntSpinBox</class>
- <extends>QSpinBox</extends>
- <header>knuminput.h</header>
- </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
diff --git a/kwin/effects/shadow/shadow_helper.h \
b/kwin/effects/shadow/shadow_helper.h deleted file mode 100644
index 6acf9d2..0000000
--- a/kwin/effects/shadow/shadow_helper.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/********************************************************************
-KWin - the KDE window manager
-This file is part of the KDE project.
-
-Copyright (C) 2008 Louai Al-Khanji <louai.khanji@gmail.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/>.
-*********************************************************************/
-
-// This contains code shared by the shadow effect and shadow effect configurator
-// Mark all functions static so the symbols are not exported!
-
-#ifndef KWIN_SHADOW_HELPER_H
-#define KWIN_SHADOW_HELPER_H
-
-#include <KColorScheme>
-#include <KColorUtils>
-
-static const int MAX_ITERS = 10; // should be enough
-static const qreal LUMA_THRESHOLD = 0.05;
-static const qreal MINIMUM_CONTRAST = 3.0;
-
-static bool contrastTooLow(const QColor& one, const QColor& two)
- {
- return KColorUtils::contrastRatio(one, two) < MINIMUM_CONTRAST;
- }
-
-static QColor schemeShadowColor()
- {
- QPalette palette;
- QColor shadowColor;
- QPalette::ColorRole shadowRole;
- QColor windowColor;
-
- windowColor = palette.color(QPalette::Window);
-
- if (KColorUtils::luma(windowColor) >= LUMA_THRESHOLD)
- shadowRole = QPalette::Shadow;
- else
- shadowRole = QPalette::Light;
-
- shadowColor = palette.color(shadowRole);
-
- // Some styles might set a weird shadow or light color. Make sure we
- // do not end up looping forever or we might lock up the desktop!!
- int iters = 0;
- while (contrastTooLow(shadowColor, windowColor) && iters < MAX_ITERS)
- {
- iters++;
- if (shadowRole == QPalette::Shadow)
- shadowColor = KColorUtils::darken(shadowColor);
- else
- shadowColor = KColorUtils::lighten(shadowColor);
- }
-
- return shadowColor;
- }
-
-#endif // KWIN_SHADOW_HELPER_H
diff --git a/kwin/kcmkwin/kwincompositing/main.cpp \
b/kwin/kcmkwin/kwincompositing/main.cpp index 2935fcd..e7e4ad0 100644
--- a/kwin/kcmkwin/kwincompositing/main.cpp
+++ b/kwin/kcmkwin/kwincompositing/main.cpp
@@ -108,7 +108,6 @@ KWinCompositingConfig::KWinCompositingConfig(QWidget *parent, \
const QVariantList
connect(ui.useCompositing, SIGNAL(toggled(bool)), this, SLOT(changed()));
connect(ui.effectWinManagement, SIGNAL(toggled(bool)), this, SLOT(changed()));
- connect(ui.effectShadows, SIGNAL(toggled(bool)), this, SLOT(changed()));
connect(ui.effectAnimations, SIGNAL(toggled(bool)), this, SLOT(changed()));
connect(ui.effectSelector, SIGNAL(changed(bool)), this, SLOT(changed()));
@@ -343,7 +342,6 @@ void KWinCompositingConfig::loadGeneralTab()
}
else
ui.effectWinManagement->setChecked(winManagementEnabled);
- ui.effectShadows->setChecked(LOAD_EFFECT_CONFIG("shadow"));
ui.effectAnimations->setChecked(LOAD_EFFECT_CONFIG("minimizeanimation"));
#undef LOAD_EFFECT_CONFIG
@@ -509,7 +507,6 @@ void KWinCompositingConfig::saveGeneralTab()
WRITE_EFFECT_CONFIG("desktopgrid", ui.effectWinManagement);
WRITE_EFFECT_CONFIG("dialogparent", ui.effectWinManagement);
}
- WRITE_EFFECT_CONFIG("shadow", ui.effectShadows);
// TODO: maybe also do some effect-specific configuration here, e.g.
// enable/disable desktopgrid's animation according to this setting
WRITE_EFFECT_CONFIG("minimizeanimation", ui.effectAnimations);
@@ -753,7 +750,6 @@ void KWinCompositingConfig::defaults()
ui.useCompositing->setChecked(mDefaultPrefs.recommendCompositing());
ui.effectWinManagement->setChecked(true);
- ui.effectShadows->setChecked(true);
ui.effectAnimations->setChecked(true);
ui.windowSwitchingCombo->setCurrentIndex( 1 );
diff --git a/kwin/kcmkwin/kwincompositing/main.ui \
b/kwin/kcmkwin/kwincompositing/main.ui index fdc71d6..81cb437 100644
--- a/kwin/kcmkwin/kwincompositing/main.ui
+++ b/kwin/kcmkwin/kwincompositing/main.ui
@@ -57,16 +57,6 @@
</widget>
</item>
<item row="1" column="0" colspan="2">
- <widget class="QCheckBox" name="effectShadows">
- <property name="text">
- <string>Shadows</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="effectAnimations">
<property name="text">
<string>Various animations</string>
@@ -76,7 +66,7 @@
</property>
</widget>
</item>
- <item row="7" column="0" colspan="2">
+ <item row="6" column="0" colspan="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -92,7 +82,7 @@
</property>
</spacer>
</item>
- <item row="8" column="0" colspan="2">
+ <item row="7" column="0" colspan="2">
<widget class="QLabel" name="label">
<property name="text">
<string>You can find more effects, as well as effect-specific \
settings, in the "All Effects" tab above.</string> @@ -102,7 +92,7 @@
</property>
</widget>
</item>
- <item row="4" column="0">
+ <item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Effect for window switching:</string>
@@ -115,7 +105,7 @@
</property>
</widget>
</item>
- <item row="4" column="1">
+ <item row="3" column="1">
<widget class="KComboBox" name="windowSwitchingCombo">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
@@ -125,7 +115,7 @@
</property>
</widget>
</item>
- <item row="5" column="1">
+ <item row="4" column="1">
<widget class="KComboBox" name="desktopSwitchingCombo">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
@@ -135,7 +125,7 @@
</property>
</widget>
</item>
- <item row="3" column="0" colspan="2">
+ <item row="2" column="0" colspan="2">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -151,7 +141,7 @@
</property>
</spacer>
</item>
- <item row="6" column="1">
+ <item row="5" column="1">
<widget class="KComboBox" name="animationSpeedCombo">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
@@ -199,7 +189,7 @@
</item>
</widget>
</item>
- <item row="6" column="0">
+ <item row="5" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Animation speed:</string>
@@ -212,7 +202,7 @@
</property>
</widget>
</item>
- <item row="5" column="0">
+ <item row="4" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Effect for desktop switching:</string>
@@ -600,7 +590,6 @@ p, li { white-space: pre-wrap; }
<tabstop>tabWidget</tabstop>
<tabstop>useCompositing</tabstop>
<tabstop>effectWinManagement</tabstop>
- <tabstop>effectShadows</tabstop>
<tabstop>effectAnimations</tabstop>
<tabstop>windowSwitchingCombo</tabstop>
<tabstop>desktopSwitchingCombo</tabstop>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic