From 5669b778e5426a75b50fcd63deaba022c25ab5bc Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 28 Apr 2010 23:48:46 +0000 Subject: 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 --- kwin/geometry.cpp | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) (limited to 'kwin') 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(); -- cgit v1.2.1