From 64dc9b1be676e54ad14ee88fcd130546846d8ef4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 25 Aug 2008 14:12:12 +0000 Subject: [PATCH] Make cylinder and sphere work with multi screen setup. Span on all screens is only option as scaling on one screen results in abstract art. So the option is removed from config dialog. svn path=/trunk/KDE/kdebase/workspace/; revision=852200 --- effects/cylinder.cpp | 5 ++++- effects/cylinder_config.cpp | 12 ------------ effects/cylinder_config.ui | 10 +--------- effects/sphere.cpp | 3 +++ effects/sphere_config.cpp | 12 ------------ effects/sphere_config.ui | 10 +--------- 6 files changed, 9 insertions(+), 43 deletions(-) diff --git a/effects/cylinder.cpp b/effects/cylinder.cpp index e5a1ed13d8..e1542bab3d 100644 --- a/effects/cylinder.cpp +++ b/effects/cylinder.cpp @@ -43,6 +43,7 @@ CylinderEffect::CylinderEffect() wallpaper->discard(); loadConfig( "Cylinder" ); animateDesktopChange = false; + bigCube = true; } CylinderEffect::~CylinderEffect() @@ -80,6 +81,8 @@ bool CylinderEffect::loadData() mShader->setUniform( "winTexture", 0 ); mShader->setUniform( "opacity", cubeOpacity ); QRect rect = effects->clientArea( FullScreenArea, activeScreen, effects->currentDesktop()); + if( effects->numScreens() > 1 && (slide || bigCube ) ) + rect = effects->clientArea( FullArea, activeScreen, effects->currentDesktop() ); mShader->setUniform( "width", (float)rect.width() ); mShader->unbind(); } @@ -89,7 +92,7 @@ bool CylinderEffect::loadData() void CylinderEffect::paintScene( int mask, QRegion region, ScreenPaintData& data ) { glPushMatrix(); - QRect rect = effects->clientArea( FullArea, activeScreen, effects->currentDesktop() ); + QRect rect = effects->clientArea( FullArea, activeScreen, effects->currentDesktop()); float cubeAngle = (effects->numberOfDesktops() - 2 )/(float)effects->numberOfDesktops() * 180.0f; float radian = (cubeAngle*0.5)*M_PI/180; diff --git a/effects/cylinder_config.cpp b/effects/cylinder_config.cpp index 2e380c5c6f..0212536a26 100644 --- a/effects/cylinder_config.cpp +++ b/effects/cylinder_config.cpp @@ -81,7 +81,6 @@ CylinderEffectConfig::CylinderEffectConfig(QWidget* parent, const QVariantList& connect(m_ui->displayDesktopNameBox, SIGNAL(stateChanged(int)), this, SLOT(changed())); connect(m_ui->reflectionBox, SIGNAL(stateChanged(int)), this, SLOT(changed())); connect(m_ui->backgroundColorButton, SIGNAL(changed(QColor)), 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())); @@ -108,7 +107,6 @@ void CylinderEffectConfig::load() QColor capColor = conf.readEntry( "CapColor", KColorScheme( QPalette::Active, KColorScheme::Window ).background().color() ); bool texturedCaps = conf.readEntry( "TexturedCaps", true ); bool caps = conf.readEntry( "Caps", true ); - bool bigCube = conf.readEntry( "BigCube", false ); bool closeOnMouseRelease = conf.readEntry( "CloseOnMouseRelease", false ); m_ui->zPositionSlider->setValue( conf.readEntry( "ZPosition", 100 ) ); m_ui->wallpaperLineEdit->setText( conf.readEntry( "Wallpaper", "" ) ); @@ -151,14 +149,6 @@ void CylinderEffectConfig::load() { m_ui->capsImageBox->setCheckState( Qt::Unchecked ); } - if( bigCube ) - { - m_ui->bigCubeBox->setCheckState( Qt::Checked ); - } - else - { - m_ui->bigCubeBox->setCheckState( Qt::Unchecked ); - } if( closeOnMouseRelease ) { m_ui->closeOnMouseReleaseBox->setCheckState( Qt::Checked ); @@ -186,7 +176,6 @@ void CylinderEffectConfig::save() conf.writeEntry( "Caps", m_ui->cubeCapsBox->checkState() == Qt::Checked ? true : false ); conf.writeEntry( "CapColor", m_ui->capColorButton->color() ); conf.writeEntry( "TexturedCaps", m_ui->capsImageBox->checkState() == Qt::Checked ? true : false ); - conf.writeEntry( "BigCube", m_ui->bigCubeBox->checkState() == Qt::Checked ? true : false ); conf.writeEntry( "CloseOnMouseRelease", m_ui->closeOnMouseReleaseBox->checkState() == Qt::Checked ? true : false ); conf.writeEntry( "Wallpaper", m_ui->wallpaperLineEdit->text() ); conf.writeEntry( "ZPosition", m_ui->zPositionSlider->value() ); @@ -216,7 +205,6 @@ void CylinderEffectConfig::defaults() m_ui->cubeCapsBox->setCheckState( Qt::Checked ); m_ui->capColorButton->setColor( KColorScheme( QPalette::Active, KColorScheme::Window ).background().color() ); m_ui->capsImageBox->setCheckState( Qt::Checked ); - m_ui->bigCubeBox->setCheckState( Qt::Unchecked ); m_ui->closeOnMouseReleaseBox->setCheckState( Qt::Unchecked ); m_ui->wallpaperLineEdit->setText( "" ); m_ui->zPositionSlider->setValue( 100 ); diff --git a/effects/cylinder_config.ui b/effects/cylinder_config.ui index 1417269512..d8f2d6da6f 100644 --- a/effects/cylinder_config.ui +++ b/effects/cylinder_config.ui @@ -176,13 +176,6 @@ - - - - S&pan cube on all screens - - - @@ -217,7 +210,7 @@ - + Close after mouse dra&gging @@ -323,7 +316,6 @@ cubeCapsBox capColorButton capsImageBox - bigCubeBox diff --git a/effects/sphere.cpp b/effects/sphere.cpp index ea5be48d35..31841a8a51 100644 --- a/effects/sphere.cpp +++ b/effects/sphere.cpp @@ -47,6 +47,7 @@ SphereEffect::SphereEffect() animateDesktopChange = false; KConfigGroup conf = effects->effectConfig( "Sphere" ); zPosition = conf.readEntry( "ZPosition", 450.0 ); + bigCube = true; } SphereEffect::~SphereEffect() @@ -84,6 +85,8 @@ bool SphereEffect::loadData() mShader->setUniform( "winTexture", 0 ); mShader->setUniform( "opacity", cubeOpacity ); QRect rect = effects->clientArea( FullScreenArea, activeScreen, effects->currentDesktop()); + if( effects->numScreens() > 1 && (slide || bigCube ) ) + rect = effects->clientArea( FullArea, activeScreen, effects->currentDesktop() ); mShader->setUniform( "width", (float)rect.width() ); mShader->setUniform( "height", (float)rect.height() ); mShader->unbind(); diff --git a/effects/sphere_config.cpp b/effects/sphere_config.cpp index 40b8109f7f..3ecaf99b04 100644 --- a/effects/sphere_config.cpp +++ b/effects/sphere_config.cpp @@ -80,7 +80,6 @@ SphereEffectConfig::SphereEffectConfig(QWidget* parent, const QVariantList& args connect(m_ui->cubeOpacitySpin, SIGNAL(valueChanged(int)), this, SLOT(changed())); connect(m_ui->displayDesktopNameBox, SIGNAL(stateChanged(int)), this, SLOT(changed())); connect(m_ui->backgroundColorButton, SIGNAL(changed(QColor)), 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())); @@ -106,7 +105,6 @@ void SphereEffectConfig::load() QColor capColor = conf.readEntry( "CapColor", KColorScheme( QPalette::Active, KColorScheme::Window ).background().color() ); bool texturedCaps = conf.readEntry( "TexturedCaps", true ); bool caps = conf.readEntry( "Caps", true ); - bool bigCube = conf.readEntry( "BigCube", false ); bool closeOnMouseRelease = conf.readEntry( "CloseOnMouseRelease", false ); m_ui->zPositionSlider->setValue( conf.readEntry( "ZPosition", 450 ) ); m_ui->wallpaperLineEdit->setText( conf.readEntry( "Wallpaper", "" ) ); @@ -141,14 +139,6 @@ void SphereEffectConfig::load() { m_ui->capsImageBox->setCheckState( Qt::Unchecked ); } - if( bigCube ) - { - m_ui->bigCubeBox->setCheckState( Qt::Checked ); - } - else - { - m_ui->bigCubeBox->setCheckState( Qt::Unchecked ); - } if( closeOnMouseRelease ) { m_ui->closeOnMouseReleaseBox->setCheckState( Qt::Checked ); @@ -175,7 +165,6 @@ void SphereEffectConfig::save() conf.writeEntry( "Caps", m_ui->cubeCapsBox->checkState() == Qt::Checked ? true : false ); conf.writeEntry( "CapColor", m_ui->capColorButton->color() ); conf.writeEntry( "TexturedCaps", m_ui->capsImageBox->checkState() == Qt::Checked ? true : false ); - conf.writeEntry( "BigCube", m_ui->bigCubeBox->checkState() == Qt::Checked ? true : false ); conf.writeEntry( "CloseOnMouseRelease", m_ui->closeOnMouseReleaseBox->checkState() == Qt::Checked ? true : false ); conf.writeEntry( "Wallpaper", m_ui->wallpaperLineEdit->text() ); conf.writeEntry( "ZPosition", m_ui->zPositionSlider->value() ); @@ -204,7 +193,6 @@ void SphereEffectConfig::defaults() m_ui->cubeCapsBox->setCheckState( Qt::Checked ); m_ui->capColorButton->setColor( KColorScheme( QPalette::Active, KColorScheme::Window ).background().color() ); m_ui->capsImageBox->setCheckState( Qt::Checked ); - m_ui->bigCubeBox->setCheckState( Qt::Unchecked ); m_ui->closeOnMouseReleaseBox->setCheckState( Qt::Unchecked ); m_ui->wallpaperLineEdit->setText( "" ); m_ui->zPositionSlider->setValue( 450 ); diff --git a/effects/sphere_config.ui b/effects/sphere_config.ui index 3816c1c70f..2e2793ef5b 100644 --- a/effects/sphere_config.ui +++ b/effects/sphere_config.ui @@ -169,13 +169,6 @@ - - - - S&pan cube on all screens - - - @@ -210,7 +203,7 @@ - + Close after mouse dra&gging @@ -315,7 +308,6 @@ cubeCapsBox capColorButton capsImageBox - bigCubeBox