Bring back optional one big cube for multi monitor setup. One big cube is used for desktop changed but not the default for ctrl+f11 mode.

BUG: 168404

svn path=/trunk/KDE/kdebase/workspace/; revision=843084
This commit is contained in:
Martin Gräßlin 2008-08-06 12:05:30 +00:00
parent 2254d23939
commit 39fd589c4d
4 changed files with 36 additions and 6 deletions

View file

@ -71,6 +71,7 @@ CubeEffect::CubeEffect()
, oldDesktop( 0 )
, activeScreen( 0 )
, animateDesktopChange( false )
, bigCube( false )
{
KConfigGroup conf = effects->effectConfig( "Cube" );
borderActivate = (ElectricBorder)conf.readEntry( "BorderActivate", (int)ElectricNone );
@ -82,6 +83,7 @@ CubeEffect::CubeEffect()
rotationDuration = conf.readEntry( "RotationDuration", 500 );
backgroundColor = conf.readEntry( "BackgroundColor", QColor( Qt::black ) );
animateDesktopChange = conf.readEntry( "AnimateDesktopChange", false );
bigCube = conf.readEntry( "BigCube", false );
capColor = conf.readEntry( "CapColor", KColorScheme( QPalette::Active, KColorScheme::Window ).background().color() );
paintCaps = conf.readEntry( "Caps", true );
QString file = conf.readEntry( "Wallpaper", QString("") );
@ -176,6 +178,8 @@ void CubeEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data )
{
//kDebug();
QRect rect = effects->clientArea( FullScreenArea, activeScreen, effects->currentDesktop());
if( effects->numScreens() > 1 && (slide || bigCube ) )
rect = effects->clientArea( FullArea, activeScreen, effects->currentDesktop() );
QRect fullRect = effects->clientArea( FullArea, activeScreen, effects->currentDesktop() );
// background
@ -197,7 +201,7 @@ void CubeEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data )
glEnable( GL_BLEND );
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
if( effects->numScreens() > 1 )
if( effects->numScreens() > 1 && !slide && !bigCube )
{
windowsOnOtherScreens.clear();
// unfortunatelly we have to change the projection matrix in dual screen mode
@ -269,7 +273,7 @@ void CubeEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data )
glPopMatrix();
glPushMatrix();
glTranslatef( 0.0, rect.height(), 0.0 );
if( effects->numScreens() > 1 && rect.width() != fullRect.width() )
if( effects->numScreens() > 1 && rect.width() != fullRect.width() && !slide && !bigCube )
{
// have to change the reflection area in horizontal layout and right screen
glTranslatef( -rect.width(), 0.0, 0.0 );
@ -301,7 +305,7 @@ void CubeEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data )
paintScene( mask, region, data );
glPopMatrix();
if( effects->numScreens() > 1 )
if( effects->numScreens() > 1 && !slide && !bigCube )
{
glPopMatrix();
// revert change of projection matrix
@ -352,7 +356,7 @@ void CubeEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data )
{
effects->paintScreen( mask, region, data );
}
if( effects->numScreens() > 1 )
if( effects->numScreens() > 1 && !slide && !bigCube )
{
foreach( EffectWindow* w, windowsOnOtherScreens )
{
@ -374,9 +378,11 @@ void CubeEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data )
void CubeEffect::paintScene( int mask, QRegion region, ScreenPaintData& data )
{
QRect rect = effects->clientArea( FullScreenArea, activeScreen, effects->currentDesktop());
if( effects->numScreens() > 1 && (slide || bigCube ) )
rect = effects->clientArea( FullArea, activeScreen, effects->currentDesktop() );
float xScale = 1.0;
float yScale = 1.0;
if( effects->numScreens() > 1 )
if( effects->numScreens() > 1 && !slide && !bigCube )
{
QRect fullRect = effects->clientArea( FullArea, activeScreen, effects->currentDesktop() );
xScale = (float)rect.width()/(float)fullRect.width();
@ -1483,6 +1489,8 @@ void CubeEffect::setActive( bool active )
double eqn[4] = {0.0, 1.0, 0.0, 0.0};
glPushMatrix();
QRect rect = effects->clientArea( FullScreenArea, activeScreen, effects->currentDesktop());
if( effects->numScreens() > 1 && bigCube )
rect = effects->clientArea( FullArea, activeScreen, effects->currentDesktop() );
glTranslatef( 0.0, rect.height(), 0.0 );
glClipPlane( GL_CLIP_PLANE0, eqn );
glPopMatrix();
@ -1505,6 +1513,8 @@ void CubeEffect::mouseChanged( const QPoint& pos, const QPoint& oldpos, Qt::Mous
if( stop || slide )
return;
QRect rect = effects->clientArea( FullScreenArea, activeScreen, effects->currentDesktop());
if( effects->numScreens() > 1 && (slide || bigCube ) )
rect = effects->clientArea( FullArea, activeScreen, effects->currentDesktop() );
if( buttons.testFlag( Qt::LeftButton ) )
{
bool repaint = false;

View file

@ -106,6 +106,7 @@ class CubeEffect
QList<EffectWindow*> windowsOnOtherScreens;
int activeScreen;
bool animateDesktopChange;
bool bigCube;
};
} // namespace

View file

@ -77,6 +77,7 @@ CubeEffectConfig::CubeEffectConfig(QWidget* parent, const QVariantList& args) :
connect(m_ui->reflectionBox, SIGNAL(stateChanged(int)), this, SLOT(changed()));
connect(m_ui->backgroundColorButton, SIGNAL(changed(QColor)), this, SLOT(changed()));
connect(m_ui->animateDesktopChangeBox, SIGNAL(stateChanged(int)), this, SLOT(changed()));
connect(m_ui->bigCubeBox, SIGNAL(stateChanged(int)), this, SLOT(changed()));
connect(m_ui->cubeCapsBox, SIGNAL(stateChanged(int)), this, SLOT(changed()));
connect(m_ui->cubeCapsBox, SIGNAL(stateChanged(int)), this, SLOT(capsSelectionChanged()));
connect(m_ui->capsImageBox, SIGNAL(stateChanged(int)), this, SLOT(changed()));
@ -101,6 +102,7 @@ void CubeEffectConfig::load()
bool texturedCaps = conf.readEntry( "TexturedCaps", true );
bool caps = conf.readEntry( "Caps", true );
bool animateChange = conf.readEntry( "AnimateDesktopChange", false );
bool bigCube = conf.readEntry( "BigCube", false );
if( activateBorder == (int)ElectricNone )
activateBorder--;
m_ui->screenEdgeCombo->setCurrentIndex( activateBorder );
@ -148,6 +150,14 @@ void CubeEffectConfig::load()
{
m_ui->animateDesktopChangeBox->setCheckState( Qt::Unchecked );
}
if( bigCube )
{
m_ui->bigCubeBox->setCheckState( Qt::Checked );
}
else
{
m_ui->bigCubeBox->setCheckState( Qt::Unchecked );
}
m_ui->backgroundColorButton->setColor( background );
m_ui->capColorButton->setColor( capColor );
capsSelectionChanged();
@ -168,6 +178,7 @@ void CubeEffectConfig::save()
conf.writeEntry( "CapColor", m_ui->capColorButton->color() );
conf.writeEntry( "TexturedCaps", m_ui->capsImageBox->checkState() == Qt::Checked ? true : false );
conf.writeEntry( "AnimateDesktopChange", m_ui->animateDesktopChangeBox->checkState() == Qt::Checked ? true : false );
conf.writeEntry( "BigCube", m_ui->bigCubeBox->checkState() == Qt::Checked ? true : false );
int activateBorder = m_ui->screenEdgeCombo->currentIndex();
if( activateBorder == (int)ELECTRIC_COUNT )
@ -195,6 +206,7 @@ void CubeEffectConfig::defaults()
m_ui->capColorButton->setColor( KColorScheme( QPalette::Active, KColorScheme::Window ).background().color() );
m_ui->capsImageBox->setCheckState( Qt::Checked );
m_ui->animateDesktopChangeBox->setCheckState( Qt::Unchecked );
m_ui->bigCubeBox->setCheckState( Qt::Unchecked );
m_ui->editor->allDefault();
emit changed(true);
}

View file

@ -6,7 +6,7 @@
<x>0</x>
<y>0</y>
<width>400</width>
<height>433</height>
<height>438</height>
</rect>
</property>
<layout class="QVBoxLayout" >
@ -193,6 +193,13 @@
</property>
</widget>
</item>
<item row="15" column="0" >
<widget class="QCheckBox" name="bigCubeBox" >
<property name="text" >
<string>S&amp;pan cube on all screens</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>