constrain number of virtual desktops

BUG: 261665

svn path=/trunk/KDE/kdebase/workspace/; revision=1214238
This commit is contained in:
Thomas Lübking 2011-01-13 19:05:28 +00:00
parent d18e95f9a6
commit 628ceadb99

View file

@ -79,6 +79,7 @@ namespace KWin
{
extern int screen_number;
static const int KWIN_MAX_NUMBER_DESKTOPS = 20;
Workspace* Workspace::_self = 0;
@ -1735,7 +1736,9 @@ void Workspace::previousDesktop()
*/
void Workspace::setNumberOfDesktops( int n )
{
if( n == numberOfDesktops() )
if ( n > KWIN_MAX_NUMBER_DESKTOPS )
n = KWIN_MAX_NUMBER_DESKTOPS;
if( n < 1 || n == numberOfDesktops() )
return;
int old_number_of_desktops = numberOfDesktops();
desktopCount_ = n;