Option to not animate windows shown on all desktops during desktop switching animation.

svn path=/trunk/KDE/kdebase/workspace/; revision=922030
This commit is contained in:
Martin Gräßlin 2009-02-06 09:39:57 +00:00
parent 7b5a71d2dd
commit a3c57fcab0
4 changed files with 133 additions and 50 deletions

View file

@ -141,7 +141,8 @@ void CubeEffect::loadConfig( QString config )
useForTabBox = conf.readEntry( "TabBox", false );
invertKeys = conf.readEntry( "InvertKeys", false );
invertMouse = conf.readEntry( "InvertMouse", false );
dontSlidePanels = conf.readEntry( "DontSlidePanels", false );
dontSlidePanels = conf.readEntry( "DontSlidePanels", true );
dontSlideStickyWindows = conf.readEntry( "DontSlideStickyWindows", true );
QString file = conf.readEntry( "Wallpaper", QString("") );
if( wallpaper )
wallpaper->discard();
@ -234,6 +235,8 @@ void CubeEffect::prePaintScreen( ScreenPrePaintData& data, int time )
recompileList = true;
if( dontSlidePanels )
panels.clear();
if( dontSlideStickyWindows )
stickyWindows.clear();
}
}
effects->prePaintScreen( data, time );
@ -558,6 +561,14 @@ void CubeEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data )
effects->paintWindow( w, 0, QRegion( w->x(), w->y(), w->width(), w->height() ), wData );
}
}
if( slide && dontSlideStickyWindows )
{
foreach( EffectWindow* w, stickyWindows )
{
WindowPaintData wData( w );
effects->paintWindow( w, 0, QRegion( w->x(), w->y(), w->width(), w->height() ), wData );
}
}
}
else
{
@ -1040,6 +1051,7 @@ void CubeEffect::postPaintScreen()
effects->destroyInputWindow( input );
windowsOnOtherScreens.clear();
panels.clear();
stickyWindows.clear();
effects->setActiveFullScreenEffect( 0 );
@ -1264,9 +1276,14 @@ void CubeEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& data, int
}
w->disablePainting( EffectWindow::PAINT_DISABLED_BY_DESKTOP );
}
if( slide && dontSlidePanels && w->isDock() && painting_desktop == effects->currentDesktop() )
if( slide && dontSlidePanels && w->isDock())
{
panels.append( w );
panels.insert( w );
}
if( slide && dontSlideStickyWindows && !w->isDock() &&
!w->isDesktop() && w->isOnAllDesktops())
{
stickyWindows.insert( w );
}
}
}
@ -1279,6 +1296,9 @@ void CubeEffect::paintWindow( EffectWindow* w, int mask, QRegion region, WindowP
{
if( slide && dontSlidePanels && w->isDock() )
return;
if( slide && dontSlideStickyWindows &&
w->isOnAllDesktops() && !w->isDock() && !w->isDesktop() )
return;
//kDebug(1212) << w->caption();
float opacity = cubeOpacity;
if( slide )

View file

@ -25,6 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <kwinglutils.h>
#include <QObject>
#include <QQueue>
#include <QSet>
namespace KWin
{
@ -116,7 +117,8 @@ class CubeEffect
int oldDesktop;
int rotationDuration;
QList<EffectWindow*> windowsOnOtherScreens;
QList<EffectWindow*> panels;
QSet<EffectWindow*> panels;
QSet<EffectWindow*> stickyWindows;
int activeScreen;
bool animateDesktopChange;
bool bigCube;
@ -129,6 +131,7 @@ class CubeEffect
bool invertMouse;
bool tabBoxMode;
bool dontSlidePanels;
bool dontSlideStickyWindows;
bool shortcutsRegistered;
// GL lists

View file

@ -85,6 +85,7 @@ CubeEffectConfig::CubeEffectConfig(QWidget* parent, const QVariantList& args) :
connect(m_ui->invertKeysBox, SIGNAL(stateChanged(int)), this, SLOT(changed()));
connect(m_ui->invertMouseBox, SIGNAL(stateChanged(int)), this, SLOT(changed()));
connect(m_ui->dontSlidePanelsBox, SIGNAL(stateChanged(int)), this, SLOT(changed()));
connect(m_ui->dontSlideStickyWindowsBox, SIGNAL(stateChanged(int)), this, SLOT(changed()));
load();
}
@ -112,7 +113,8 @@ void CubeEffectConfig::load()
m_ui->wallpaperRequester->setPath( conf.readEntry( "Wallpaper", "" ) );
bool invertKeys = conf.readEntry( "InvertKeys", false );
bool invertMouse = conf.readEntry( "InvertMouse", false );
bool dontSlidePanels = conf.readEntry( "DontSlidePanels", false );
bool dontSlidePanels = conf.readEntry( "DontSlidePanels", true );
bool dontSlideStickyWindows = conf.readEntry( "DontSlideStickyWindows", true );
m_ui->rotationDurationSpin->setValue( duration );
m_ui->cubeOpacitySlider->setValue( opacity );
@ -187,6 +189,7 @@ void CubeEffectConfig::load()
m_ui->invertKeysBox->setChecked( invertKeys );
m_ui->invertMouseBox->setChecked( invertMouse );
m_ui->dontSlidePanelsBox->setChecked( dontSlidePanels );
m_ui->dontSlideStickyWindowsBox->setChecked( dontSlideStickyWindows );
capsSelectionChanged();
emit changed(false);
@ -214,6 +217,7 @@ void CubeEffectConfig::save()
conf.writeEntry( "InvertKeys", m_ui->invertKeysBox->isChecked() );
conf.writeEntry( "InvertMouse", m_ui->invertMouseBox->isChecked() );
conf.writeEntry( "DontSlidePanels", m_ui->dontSlidePanelsBox->isChecked() );
conf.writeEntry( "DontSlideStickyWindows", m_ui->dontSlideStickyWindowsBox->isChecked() );
m_ui->editor->save();
@ -243,7 +247,8 @@ void CubeEffectConfig::defaults()
m_ui->walkThroughDesktopBox->setCheckState( Qt::Unchecked );
m_ui->invertKeysBox->setChecked( false );
m_ui->invertMouseBox->setChecked( false );
m_ui->dontSlidePanelsBox->setChecked( false );
m_ui->dontSlidePanelsBox->setChecked( true );
m_ui->dontSlideStickyWindowsBox->setChecked( true );
m_ui->editor->allDefault();
emit changed(true);
}

View file

@ -5,7 +5,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>700</width>
<width>747</width>
<height>566</height>
</rect>
</property>
@ -314,23 +314,10 @@
</property>
</widget>
</item>
<item row="3" column="0" >
<spacer name="verticalSpacer_4" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="1" column="0" colspan="2" >
<item row="2" column="0" colspan="2" >
<widget class="QGroupBox" name="groupBox_2" >
<property name="title" >
<string>Zoom</string>
@ -381,7 +368,7 @@
</layout>
</widget>
</item>
<item row="3" column="0" colspan="2" >
<item row="4" column="0" colspan="2" >
<spacer name="verticalSpacer" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
@ -394,29 +381,12 @@
</property>
</spacer>
</item>
<item row="0" column="1" >
<item rowspan="2" row="0" column="1" >
<widget class="QGroupBox" name="groupBox_9" >
<property name="title" >
<string>Additional Options</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout" >
<item>
<widget class="QCheckBox" name="animateDesktopChangeBox" >
<property name="toolTip" >
<string/>
</property>
<property name="text" >
<string>Display the cube when switching desktops</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="dontSlidePanelsBox" >
<property name="text" >
<string>Fix panels while switching desktops</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="bigCubeBox" >
<property name="toolTip" >
@ -460,6 +430,58 @@ otherwise it will remain active</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_4" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="1" column="0" >
<widget class="QGroupBox" name="groupBox" >
<property name="title" >
<string>Animate Desktop Change</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2" >
<item>
<widget class="QCheckBox" name="animateDesktopChangeBox" >
<property name="toolTip" >
<string/>
</property>
<property name="text" >
<string>Display the cube when switching desktops</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="dontSlidePanelsBox" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="text" >
<string>Do not animate panels</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="dontSlideStickyWindowsBox" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="text" >
<string>Do not animate windows on all desktops</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
@ -501,13 +523,14 @@ otherwise it will remain active</string>
<tabstop>cubeCapsBox</tabstop>
<tabstop>capColorButton</tabstop>
<tabstop>capsImageBox</tabstop>
<tabstop>animateDesktopChangeBox</tabstop>
<tabstop>dontSlidePanelsBox</tabstop>
<tabstop>bigCubeBox</tabstop>
<tabstop>closeOnMouseReleaseBox</tabstop>
<tabstop>walkThroughDesktopBox</tabstop>
<tabstop>invertKeysBox</tabstop>
<tabstop>invertMouseBox</tabstop>
<tabstop>animateDesktopChangeBox</tabstop>
<tabstop>dontSlidePanelsBox</tabstop>
<tabstop>dontSlideStickyWindowsBox</tabstop>
<tabstop>zPositionSlider</tabstop>
</tabstops>
<resources/>
@ -519,12 +542,12 @@ otherwise it will remain active</string>
<slot>setValue(int)</slot>
<hints>
<hint type="sourcelabel" >
<x>386</x>
<y>175</y>
<x>725</x>
<y>102</y>
</hint>
<hint type="destinationlabel" >
<x>235</x>
<y>162</y>
<x>568</x>
<y>101</y>
</hint>
</hints>
</connection>
@ -535,12 +558,44 @@ otherwise it will remain active</string>
<slot>setValue(int)</slot>
<hints>
<hint type="sourcelabel" >
<x>133</x>
<y>162</y>
<x>466</x>
<y>101</y>
</hint>
<hint type="destinationlabel" >
<x>386</x>
<y>175</y>
<x>725</x>
<y>102</y>
</hint>
</hints>
</connection>
<connection>
<sender>animateDesktopChangeBox</sender>
<signal>toggled(bool)</signal>
<receiver>dontSlidePanelsBox</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>147</x>
<y>209</y>
</hint>
<hint type="destinationlabel" >
<x>147</x>
<y>232</y>
</hint>
</hints>
</connection>
<connection>
<sender>animateDesktopChangeBox</sender>
<signal>toggled(bool)</signal>
<receiver>dontSlideStickyWindowsBox</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>53</x>
<y>209</y>
</hint>
<hint type="destinationlabel" >
<x>27</x>
<y>261</y>
</hint>
</hints>
</connection>