From 010798db4454b426fd10f9d9cbd20de082bd7193 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sat, 6 Dec 2008 22:51:57 +0000 Subject: [PATCH] Some more multi screen voodoo. Thanks to kwin not crashing any more when changing layout and/or resolution I'm quite confident that the layout works with all possible two screen layouts. svn path=/trunk/KDE/kdebase/workspace/; revision=893587 --- effects/coverswitch.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/effects/coverswitch.cpp b/effects/coverswitch.cpp index ffd02f3bf2..b7369a1990 100644 --- a/effects/coverswitch.cpp +++ b/effects/coverswitch.cpp @@ -566,10 +566,13 @@ void CoverSwitchEffect::tabBoxAdded( int mode ) scaleFactor = (zPosition+1100) * 2.0 * tan( 60.0 * M_PI / 360.0f )/displayWidth(); if( displayWidth()-area.width() != 0 ) { - if( area.width() < displayWidth() * 0.5f ) + // one of the screens is smaller than the other (horizontal) + if( area.width() < displayWidth() - area.width() ) scaleFactor *= (float)area.width()/(float)(displayWidth()-area.width()); - else + else if( area.width() != displayWidth() - area.width() ) { + // vertical layout with different width + // but we don't want to catch screens with same width and different height if( displayHeight() != area.height() ) scaleFactor *= (float)area.width()/(float)(displayWidth()); }