From db06887076745669c840cea17691ef60749835f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Wed, 21 Nov 2007 18:50:38 +0000 Subject: [PATCH] Fix xinerama. BUG: 152370 svn path=/trunk/KDE/kdebase/workspace/; revision=739736 --- effects/boxswitch.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/effects/boxswitch.cpp b/effects/boxswitch.cpp index 2928818220..b30a4e3089 100644 --- a/effects/boxswitch.cpp +++ b/effects/boxswitch.cpp @@ -387,7 +387,8 @@ void BoxSwitchEffect::calculateFrameSize() const int separator_height = 6; // Shrink the size until all windows/desktops can fit onscreen frame_area.setWidth( frame_margin * 2 + itemcount * item_max_size.width()); - while( frame_area.width() > displayWidth()) + QRect screenr = effects->clientArea( PlacementArea, effects->activeScreen(), effects->currentDesktop()); + while( frame_area.width() > screenr.width()) { item_max_size /= 2; frame_area.setWidth( frame_margin * 2 + itemcount * item_max_size.width()); @@ -396,7 +397,8 @@ void BoxSwitchEffect::calculateFrameSize() separator_height + text_area.height()); text_area.setWidth( frame_area.width() - frame_margin * 2 ); - frame_area.moveTo(( displayWidth() - frame_area.width()) / 2, ( displayHeight() - frame_area.height()) / 2 ); + frame_area.moveTo( screenr.x() + ( screenr.width() - frame_area.width()) / 2, + screenr.y() + ( screenr.height() - frame_area.height()) / 2 ); text_area.moveTo( frame_area.x() + frame_margin, frame_area.y() + frame_margin + item_max_size.height() + separator_height); }