From c83210c60a4911cfbf6116bab9ee7eca0074d89a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Tue, 20 Nov 2007 16:07:20 +0000 Subject: [PATCH] Remove all code for non-composited animations - they don't work anyway. svn path=/trunk/KDE/kdebase/workspace/; revision=739143 --- bridge.cpp | 8 --- bridge.h | 1 - kcmkwin/kwindecoration/preview.cpp | 4 -- kcmkwin/kwindecoration/preview.h | 1 - kcmkwin/kwinoptions/windows.cpp | 85 ------------------------------ kcmkwin/kwinoptions/windows.h | 11 +--- kwin.kcfg | 3 -- lib/kdecoration.cpp | 10 ---- lib/kdecoration.h | 19 ------- lib/kdecoration_p.h | 1 - options.cpp | 4 -- options.h | 15 ------ tools/decobenchmark/preview.cpp | 4 -- tools/decobenchmark/preview.h | 1 - 14 files changed, 1 insertion(+), 166 deletions(-) diff --git a/bridge.cpp b/bridge.cpp index 12e5b479d7..0a4be96d28 100644 --- a/bridge.cpp +++ b/bridge.cpp @@ -145,14 +145,6 @@ Qt::WFlags Bridge::initialWFlags() const return 0; } -void Bridge::helperShowHide( bool show ) - { - if( show ) - c->rawShow(); - else - c->rawHide(); - } - QRegion Bridge::unobscuredRegion( const QRegion& r ) const { QRegion reg( r ); diff --git a/bridge.h b/bridge.h index f7f2f94eef..db9f1a36a5 100644 --- a/bridge.h +++ b/bridge.h @@ -63,7 +63,6 @@ class Bridge : public KDecorationBridge virtual int currentDesktop() const; virtual QWidget* initialParentWidget() const; virtual Qt::WFlags initialWFlags() const; - virtual void helperShowHide( bool show ); virtual void grabXServer( bool grab ); private: Client* c; diff --git a/kcmkwin/kwindecoration/preview.cpp b/kcmkwin/kwindecoration/preview.cpp index 5fbc66ab01..7f6b9647ba 100644 --- a/kcmkwin/kwindecoration/preview.cpp +++ b/kcmkwin/kwindecoration/preview.cpp @@ -425,10 +425,6 @@ int KDecorationPreviewBridge::currentDesktop() const return 1; } -void KDecorationPreviewBridge::helperShowHide( bool ) - { - } - void KDecorationPreviewBridge::grabXServer( bool ) { } diff --git a/kcmkwin/kwindecoration/preview.h b/kcmkwin/kwindecoration/preview.h index 114ed68470..32a7bb310e 100644 --- a/kcmkwin/kwindecoration/preview.h +++ b/kcmkwin/kwindecoration/preview.h @@ -110,7 +110,6 @@ class KDecorationPreviewBridge virtual int currentDesktop() const; virtual QWidget* initialParentWidget() const; virtual Qt::WFlags initialWFlags() const; - virtual void helperShowHide( bool show ); virtual void grabXServer( bool grab ); private: KDecorationPreview* preview; diff --git a/kcmkwin/kwinoptions/windows.cpp b/kcmkwin/kwinoptions/windows.cpp index 54b45150de..251e8090d2 100644 --- a/kcmkwin/kwinoptions/windows.cpp +++ b/kcmkwin/kwinoptions/windows.cpp @@ -61,8 +61,6 @@ #define KWIN_FOCUS "FocusPolicy" #define KWIN_PLACEMENT "Placement" #define KWIN_MOVE "MoveMode" -#define KWIN_MINIMIZE_ANIM "AnimateMinimize" -#define KWIN_MINIMIZE_ANIM_SPEED "AnimateMinimizeSpeed" #define KWIN_RESIZE_OPAQUE "ResizeMode" #define KWIN_GEOMETRY "GeometryTip" #define KWIN_AUTORAISE_INTERVAL "AutoRaiseInterval" @@ -70,7 +68,6 @@ #define KWIN_DELAYFOCUS_INTERVAL "DelayFocusInterval" #define KWIN_DELAYFOCUS "DelayFocus" #define KWIN_CLICKRAISE "ClickRaise" -#define KWIN_ANIMSHADE "AnimateShade" #define KWIN_MOVE_RESIZE_MAXIMIZED "MoveResizeMaximizedWindows" #define KWIN_ALTTABMODE "AltTabStyle" #define KWIN_TRAVERSE_ALL "TraverseAll" @@ -581,10 +578,6 @@ KAdvancedConfig::KAdvancedConfig (bool _standAlone, KConfig *_config, const KCom shBox = new Q3VButtonGroup(i18n("Shading"), this); - animateShade = new QCheckBox(i18n("Anima&te"), shBox); - animateShade->setWhatsThis( i18n("Animate the action of reducing the window to its titlebar (shading)" - " as well as the expansion of a shaded window") ); - shadeHoverOn = new QCheckBox(i18n("&Enable hover"), shBox); connect(shadeHoverOn, SIGNAL(toggled(bool)), this, SLOT(shadeHoverChanged(bool))); @@ -605,7 +598,6 @@ KAdvancedConfig::KAdvancedConfig (bool _standAlone, KConfig *_config, const KCom lay->addWidget(shBox); // Any changes goes to slotChanged() - connect(animateShade, SIGNAL(toggled(bool)), SLOT(changed())); connect(shadeHoverOn, SIGNAL(toggled(bool)), SLOT(changed())); connect(shadeHover, SIGNAL(valueChanged(int)), SLOT(changed())); @@ -702,10 +694,6 @@ void KAdvancedConfig::shadeHoverChanged(bool a) { shadeHover->setEnabled(a); } -void KAdvancedConfig::setAnimateShade(bool a) { - animateShade->setChecked(a); -} - void KAdvancedConfig::setFocusStealing(int l) { l = qMax( 0, qMin( 4, l )); focusStealing->setCurrentIndex(l); @@ -719,7 +707,6 @@ void KAdvancedConfig::load( void ) { KConfigGroup cg(config, "Windows"); - setAnimateShade(cg.readEntry(KWIN_ANIMSHADE, true)); setShadeHover(cg.readEntry(KWIN_SHADEHOVER, false)); setShadeHoverInterval(cg.readEntry(KWIN_SHADEHOVER_INTERVAL, 250)); @@ -739,7 +726,6 @@ void KAdvancedConfig::save( void ) int v; KConfigGroup cg(config, "Windows"); - cg.writeEntry(KWIN_ANIMSHADE, animateShade->isChecked()); cg.writeEntry(KWIN_SHADEHOVER, shadeHoverOn->isChecked()); v = getShadeHoverInterval(); @@ -766,7 +752,6 @@ void KAdvancedConfig::save( void ) void KAdvancedConfig::defaults() { - setAnimateShade(true); setShadeHover(false); setShadeHoverInterval(250); setElectricBorders(0); @@ -861,38 +846,6 @@ KMovingConfig::KMovingConfig (bool _standAlone, KConfig *_config, const KCompone rLay->setColumnStretch(0,0); rLay->setColumnStretch(1,1); - minimizeAnimOn = new QCheckBox(i18n("Animate minimi&ze and restore"), - windowsBox); - minimizeAnimOn->setWhatsThis( i18n("Enable this option if you want an animation shown when" - " windows are minimized or restored." ) ); - rLay->addWidget(minimizeAnimOn,0,0); - - minimizeAnimSlider = new QSlider(windowsBox); - minimizeAnimSlider->setRange( 0, 10 ); - minimizeAnimSlider->setSingleStep( 1 ); - minimizeAnimSlider->setPageStep( 1 ); - minimizeAnimSlider->setValue( 0 ); - minimizeAnimSlider->setOrientation( Qt::Horizontal ); - minimizeAnimSlider->setTickPosition(QSlider::TicksBelow); - rLay->addWidget(minimizeAnimSlider,0,1,1,2); - - connect(minimizeAnimOn, SIGNAL(toggled(bool)), this, SLOT(setMinimizeAnim(bool))); - connect(minimizeAnimSlider, SIGNAL(valueChanged(int)), this, SLOT(setMinimizeAnimSpeed(int))); - - minimizeAnimSlowLabel= new QLabel(i18n("Slow"),windowsBox); - minimizeAnimSlowLabel->setAlignment(Qt::AlignTop|Qt::AlignLeft); - rLay->addWidget(minimizeAnimSlowLabel,1,1); - - minimizeAnimFastLabel= new QLabel(i18n("Fast"),windowsBox); - minimizeAnimFastLabel->setAlignment(Qt::AlignTop|Qt::AlignRight); - rLay->addWidget(minimizeAnimFastLabel,1,2); - - wtstr = i18n("Here you can set the speed of the animation shown when windows are" - " minimized and restored. "); - minimizeAnimSlider->setWhatsThis( wtstr ); - minimizeAnimSlowLabel->setWhatsThis( wtstr ); - minimizeAnimFastLabel->setWhatsThis( wtstr ); - moveResizeMaximized = new QCheckBox( i18n("Allow moving and resizing o&f maximized windows"), windowsBox); bLay->addWidget(moveResizeMaximized); moveResizeMaximized->setWhatsThis( i18n("When enabled, this feature activates the border of maximized windows" @@ -992,8 +945,6 @@ KMovingConfig::KMovingConfig (bool _standAlone, KConfig *_config, const KCompone connect( opaque, SIGNAL(clicked()), SLOT(changed())); connect( resizeOpaqueOn, SIGNAL(clicked()), SLOT(changed())); connect( geometryTipOn, SIGNAL(clicked()), SLOT(changed())); - connect( minimizeAnimOn, SIGNAL(clicked() ), SLOT(changed())); - connect( minimizeAnimSlider, SIGNAL(valueChanged(int)), SLOT(changed())); connect( moveResizeMaximized, SIGNAL(toggled(bool)), SLOT(changed())); connect( placementCombo, SIGNAL(activated(int)), SLOT(changed())); connect( BrdrSnap, SIGNAL(valueChanged(int)), SLOT(changed())); @@ -1038,29 +989,6 @@ void KMovingConfig::setPlacement(int plac) placementCombo->setCurrentIndex(plac); } -bool KMovingConfig::getMinimizeAnim() -{ - return minimizeAnimOn->isChecked(); -} - -int KMovingConfig::getMinimizeAnimSpeed() -{ - return minimizeAnimSlider->value(); -} - -void KMovingConfig::setMinimizeAnim(bool anim) -{ - minimizeAnimOn->setChecked( anim ); - minimizeAnimSlider->setEnabled( anim ); - minimizeAnimSlowLabel->setEnabled( anim ); - minimizeAnimFastLabel->setEnabled( anim ); -} - -void KMovingConfig::setMinimizeAnimSpeed(int speed) -{ - minimizeAnimSlider->setValue(speed); -} - int KMovingConfig::getResizeOpaque() { return (resizeOpaqueOn->isChecked())? RESIZE_OPAQUE : RESIZE_TRANSPARENT; @@ -1095,14 +1023,6 @@ void KMovingConfig::load( void ) else if( key == "Opaque") setMove(OPAQUE); - //CT 17Jun1998 - variable animation speed from 0 (none!!) to 10 (max) - bool anim = cg.readEntry(KWIN_MINIMIZE_ANIM, true); - int animSpeed = cg.readEntry(KWIN_MINIMIZE_ANIM_SPEED, 5); - if( animSpeed < 1 ) animSpeed = 0; - if( animSpeed > 10 ) animSpeed = 10; - setMinimizeAnim( anim ); - setMinimizeAnimSpeed( animSpeed ); - // DF: please keep the default consistent with kwin (options.cpp line 145) key = cg.readEntry(KWIN_RESIZE_OPAQUE, "Opaque"); if( key == "Opaque") @@ -1203,9 +1123,6 @@ void KMovingConfig::save( void ) else cg.writeEntry(KWIN_PLACEMENT, "Smart"); - cg.writeEntry(KWIN_MINIMIZE_ANIM, getMinimizeAnim()); - cg.writeEntry(KWIN_MINIMIZE_ANIM_SPEED, getMinimizeAnimSpeed()); - v = getResizeOpaque(); if (v == RESIZE_OPAQUE) cg.writeEntry(KWIN_RESIZE_OPAQUE, "Opaque"); @@ -1243,8 +1160,6 @@ void KMovingConfig::defaults() setBorderSnapZone(KWM_BRDR_SNAP_ZONE_DEFAULT); OverlapSnap->setChecked(false); - setMinimizeAnim( true ); - setMinimizeAnimSpeed( 5 ); emit KCModule::changed(true); } diff --git a/kcmkwin/kwinoptions/windows.h b/kcmkwin/kwinoptions/windows.h index 3e6b8e7142..5c3f61b182 100644 --- a/kcmkwin/kwinoptions/windows.h +++ b/kcmkwin/kwinoptions/windows.h @@ -141,16 +141,12 @@ public: void defaults(); private slots: - void setMinimizeAnim( bool ); - void setMinimizeAnimSpeed( int ); - void changed() { emit KCModule::changed(true); } + void changed() { emit KCModule::changed(true); } void slotBrdrSnapChanged( int ); void slotWndwSnapChanged( int ); private: int getMove( void ); - bool getMinimizeAnim( void ); - int getMinimizeAnimSpeed( void ); int getResizeOpaque ( void ); bool getGeometryTip( void ); //KS int getPlacement( void ); //CT @@ -165,9 +161,6 @@ private: QCheckBox *opaque; QCheckBox *resizeOpaqueOn; QCheckBox *geometryTipOn; - QCheckBox* minimizeAnimOn; - QSlider *minimizeAnimSlider; - QLabel *minimizeAnimSlowLabel, *minimizeAnimFastLabel; QCheckBox *moveResizeMaximized; QComboBox *placementCombo; @@ -208,11 +201,9 @@ private slots: private: int getShadeHoverInterval (void ); - void setAnimateShade(bool); void setShadeHover(bool); void setShadeHoverInterval(int); - QCheckBox *animateShade; Q3ButtonGroup *shBox; QCheckBox *shadeHoverOn; KIntNumInput *shadeHover; diff --git a/kwin.kcfg b/kwin.kcfg index b81568ab7f..cf6537ebed 100644 --- a/kwin.kcfg +++ b/kwin.kcfg @@ -36,15 +36,12 @@ - - - diff --git a/lib/kdecoration.cpp b/lib/kdecoration.cpp index a072c64e87..7d24ed53cf 100644 --- a/lib/kdecoration.cpp +++ b/lib/kdecoration.cpp @@ -308,21 +308,11 @@ bool KDecoration::drawbound( const QRect&, bool ) return false; } -bool KDecoration::animateMinimize( bool ) - { - return false; - } - bool KDecoration::windowDocked( Position ) { return false; } -void KDecoration::helperShowHide( bool show ) - { - bridge_->helperShowHide( show ); - } - void KDecoration::reset( unsigned long ) { } diff --git a/lib/kdecoration.h b/lib/kdecoration.h index c9147e88e5..695172579f 100644 --- a/lib/kdecoration.h +++ b/lib/kdecoration.h @@ -662,18 +662,6 @@ class KWIN_EXPORT KDecoration * @see geometry() */ virtual bool drawbound( const QRect& geom, bool clear ); - /** - * This function may be reimplemented to provide custom minimize/restore animations - * The reimplementation is allowed to perform X server grabs if necessary - * (only using the functions provided by this API, no direct Xlib calls), but no - * futher event processing is allowed (i.e. no kapp->processEvents()). - * @a False should be returned if the default implementation should be used. - * Note that you should not use this function to force disabling of the animation. - * See @p drawbound() for details on how to do the painting. - * - * @see geometry() and helperShowHide(). - */ - virtual bool animateMinimize( bool minimize ); /** * @internal Reserved. */ @@ -717,13 +705,6 @@ class KWIN_EXPORT KDecoration * or WStyle_NoBorder are forbidden. */ Qt::WFlags initialWFlags() const; - /** - * This function is only allowed to be called once from animateMinimize(). - * It can be used if the window should be shown or hidden at a specific - * time during the animation. It is forbidden to use this function - * for other purposes. - */ - void helperShowHide( bool show ); /** * Returns the main widget for the decoration. */ diff --git a/lib/kdecoration_p.h b/lib/kdecoration_p.h index d3a04057f4..9b09220124 100644 --- a/lib/kdecoration_p.h +++ b/lib/kdecoration_p.h @@ -103,7 +103,6 @@ class KDecorationBridge : public KDecorationDefines virtual int currentDesktop() const = 0; virtual QWidget* initialParentWidget() const = 0; virtual Qt::WFlags initialWFlags() const = 0; - virtual void helperShowHide( bool ) = 0; virtual void grabXServer( bool grab ) = 0; }; diff --git a/options.cpp b/options.cpp index 0cdfd86676..52538cea8d 100644 --- a/options.cpp +++ b/options.cpp @@ -107,10 +107,6 @@ unsigned long Options::updateSettings() xineramaPlacementScreen = qBound( -1, config.readEntry( "XineramaPlacementScreen", -1 ), qApp->desktop()->numScreens() - 1 ); - animateShade = config.readEntry("AnimateShade", true); - animateMinimize = config.readEntry("AnimateMinimize", true); - animateMinimizeSpeed = config.readEntry("AnimateMinimizeSpeed", 5 ); - if( focusPolicy == ClickToFocus ) { autoRaise = false; diff --git a/options.h b/options.h index 4efee911af..35af7294e1 100644 --- a/options.h +++ b/options.h @@ -161,11 +161,6 @@ class Options : public KDecorationOptions return focusPolicy == ClickToFocus || focusPolicy == FocusFollowsMouse; } - /** - * whether we animate the shading of windows to titlebar or not - */ - bool animateShade; - /** * the size of the zone that triggers snapping on desktop borders */ @@ -182,16 +177,6 @@ class Options : public KDecorationOptions */ bool snapOnlyWhenOverlapping; - /** - * whether we animate the minimization of windows or not - */ - bool animateMinimize; - - /** - * Animation speed (0 .. 10 ) - */ - int animateMinimizeSpeed; - bool showDesktopIsMinimizeAll; /** diff --git a/tools/decobenchmark/preview.cpp b/tools/decobenchmark/preview.cpp index 3782885a52..ebef319819 100644 --- a/tools/decobenchmark/preview.cpp +++ b/tools/decobenchmark/preview.cpp @@ -378,10 +378,6 @@ int KDecorationPreviewBridge::currentDesktop() const return 1; } -void KDecorationPreviewBridge::helperShowHide( bool ) - { - } - void KDecorationPreviewBridge::grabXServer( bool ) { } diff --git a/tools/decobenchmark/preview.h b/tools/decobenchmark/preview.h index d114871610..1785888b09 100644 --- a/tools/decobenchmark/preview.h +++ b/tools/decobenchmark/preview.h @@ -101,7 +101,6 @@ class KDecorationPreviewBridge virtual int currentDesktop() const; virtual QWidget* initialParentWidget() const; virtual Qt::WFlags initialWFlags() const; - virtual void helperShowHide( bool show ); virtual void grabXServer( bool grab ); private: KDecorationPreview* preview;