From 47fce840b066937e072c91cd84574d249de85555 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sat, 28 Aug 2010 08:08:12 +0000 Subject: [PATCH] Forward port rev 1169040: Add sanity check to DesktopGrid in case of pager layout and only one desktop. Pager reported two rows, which does not make sense and caused the grid to be in an inconsistent state. CCBUG: 248817 svn path=/trunk/KDE/kdebase/workspace/; revision=1169041 --- effects/desktopgrid/desktopgrid.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/effects/desktopgrid/desktopgrid.cpp b/effects/desktopgrid/desktopgrid.cpp index 57cc30d76e..7f634a7d4c 100644 --- a/effects/desktopgrid/desktopgrid.cpp +++ b/effects/desktopgrid/desktopgrid.cpp @@ -1250,6 +1250,11 @@ void DesktopGridEffect::setupGrid() case LayoutPager: orientation = Qt::Horizontal; gridSize = effects->desktopGridSize(); + // sanity check: pager may report incorrect size in case of one desktop + if( numDesktops == 1 ) + { + gridSize = QSize( 1, 1 ); + } break; case LayoutAutomatic: y = sqrt( float( numDesktops ) ) + 0.5;