From 1d9d9897359b24343544a6eac9f60bf2cd3f1fa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Thu, 13 Jan 2011 19:08:41 +0000 Subject: [PATCH] backport 1214238, VD constrainment CCBUG: 261665 svn path=/branches/KDE/4.6/kdebase/workspace/; revision=1214242 --- workspace.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/workspace.cpp b/workspace.cpp index b124df69ff..56fad15e47 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -79,6 +79,7 @@ namespace KWin { extern int screen_number; +static const int KWIN_MAX_NUMBER_DESKTOPS = 20; Workspace* Workspace::_self = 0; @@ -1729,7 +1730,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;