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
This commit is contained in:
Martin Gräßlin 2010-08-28 08:08:12 +00:00
parent 94bfeb3cfa
commit 47fce840b0

View file

@ -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;