summaryrefslogtreecommitdiffstats
path: root/kwin/geometry.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-04-28 23:48:46 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-04-28 23:48:46 +0000
commit5669b778e5426a75b50fcd63deaba022c25ab5bc (patch)
treef4516b2106a5b7af64701058b33078b48db37735 /kwin/geometry.cpp
parent42980db88eb93f14e24416b8cf0ba68da44c2cde (diff)
downloadtdebase-5669b778e5426a75b50fcd63deaba022c25ab5bc.tar.gz
tdebase-5669b778e5426a75b50fcd63deaba022c25ab5bc.zip
Major enhancements to desktop screen switching--now switches screens in half the time needed before!
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1120367 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kwin/geometry.cpp')
-rw-r--r--kwin/geometry.cpp38
1 files changed, 28 insertions, 10 deletions
diff --git a/kwin/geometry.cpp b/kwin/geometry.cpp
index cff5a3a19..4aa520d6f 100644
--- a/kwin/geometry.cpp
+++ b/kwin/geometry.cpp
@@ -43,7 +43,7 @@ namespace KWinInternal
*/
void Workspace::desktopResized()
{
- printf("Workspace::desktopResized()\n\r");
+ //printf("Workspace::desktopResized()\n\r");
QRect geom = KApplication::desktop()->geometry();
NETSize desktop_geometry;
desktop_geometry.width = geom.width();
@@ -59,7 +59,7 @@ void Workspace::desktopResized()
*/
void Workspace::kDestopResized()
{
- printf("Workspace::kDesktopResized()\n\r");
+ //printf("Workspace::kDesktopResized()\n\r");
QRect geom = KApplication::desktop()->geometry();
NETSize desktop_geometry;
desktop_geometry.width = geom.width();
@@ -232,38 +232,53 @@ QRect Workspace::clientArea( clientAreaOption opt, int screen, int desktop ) con
{
if( desktop == NETWinInfo::OnAllDesktops || desktop == 0 )
desktop = currentDesktop();
- QDesktopWidget *desktopwidget = KApplication::desktop();
+ QDesktopWidget *desktopwidget = kapp->desktop();
QRect sarea = screenarea // may be NULL during KWin initialization
? screenarea[ desktop ][ screen ]
: desktopwidget->screenGeometry( screen );
QRect warea = workarea[ desktop ].isNull()
- ? QApplication::desktop()->geometry()
+ ? kapp->desktop()->geometry()
: workarea[ desktop ];
switch (opt)
{
case MaximizeArea:
if (options->xineramaMaximizeEnabled)
- return sarea;
+ if (desktopwidget->numScreens() < 2)
+ return warea;
+ else
+ return sarea;
else
return warea;
case MaximizeFullArea:
if (options->xineramaMaximizeEnabled)
- return desktopwidget->screenGeometry( screen );
+ if (desktopwidget->numScreens() < 2)
+ return desktopwidget->geometry();
+ else
+ return desktopwidget->screenGeometry( screen );
else
return desktopwidget->geometry();
case FullScreenArea:
if (options->xineramaFullscreenEnabled)
- return desktopwidget->screenGeometry( screen );
+ if (desktopwidget->numScreens() < 2)
+ return desktopwidget->geometry();
+ else
+ return desktopwidget->screenGeometry( screen );
else
return desktopwidget->geometry();
case PlacementArea:
if (options->xineramaPlacementEnabled)
- return sarea;
+ if (desktopwidget->numScreens() < 2)
+ return warea;
+ else
+ return sarea;
else
return warea;
case MovementArea:
if (options->xineramaMovementEnabled)
- return desktopwidget->screenGeometry( screen );
+ if (desktopwidget->numScreens() < 2)
+ return desktopwidget->geometry();
+ else
+ return desktopwidget->screenGeometry( screen );
else
return desktopwidget->geometry();
case WorkArea:
@@ -271,7 +286,10 @@ QRect Workspace::clientArea( clientAreaOption opt, int screen, int desktop ) con
case FullArea:
return desktopwidget->geometry();
case ScreenArea:
- return desktopwidget->screenGeometry( screen );
+ if (desktopwidget->numScreens() < 2)
+ return desktopwidget->geometry();
+ else
+ return desktopwidget->screenGeometry( screen );
}
assert( false );
return QRect();