From c84d39b5df2d15fa57580f6c5909b0ccb2ae34a0 Mon Sep 17 00:00:00 2001 From: Lucas Murray Date: Sat, 15 Nov 2008 11:38:26 +0000 Subject: [PATCH] Complete port to Kephal. svn path=/trunk/KDE/kdebase/workspace/; revision=884554 --- options.cpp | 4 +++- scene.cpp | 12 +++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/options.cpp b/options.cpp index c501c882e3..d4d701a335 100644 --- a/options.cpp +++ b/options.cpp @@ -35,6 +35,8 @@ along with this program. If not, see . #include "client.h" #include "compositingprefs.h" +#include + #endif namespace KWin @@ -101,7 +103,7 @@ unsigned long Options::updateSettings() placement = Placement::policyFromString( config.readEntry("Placement"), true ); xineramaPlacementScreen = qBound( -1, config.readEntry( "XineramaPlacementScreen", -1 ), - qApp->desktop()->numScreens() - 1 ); + Kephal::ScreenUtils::numScreens() - 1 ); if( focusPolicy == ClickToFocus ) { diff --git a/scene.cpp b/scene.cpp index 15becfd306..7e4ee3d081 100644 --- a/scene.cpp +++ b/scene.cpp @@ -77,7 +77,7 @@ along with this program. If not, see . #include "deleted.h" #include "effects.h" -#include +#include namespace KWin { @@ -323,13 +323,15 @@ void Scene::finalDrawWindow( EffectWindowImpl* w, int mask, QRegion region, Wind QList< QPoint > Scene::selfCheckPoints() const { QList< QPoint > ret; - // Use QDesktopWidget directly, we're interested in "real" screens, not depending on our config. + // Use Kephal directly, we're interested in "real" screens, not depending on our config. + // TODO: Does Kephal allow fake screens as well? We cannot use QDesktopWidget as it will cause a crash if + // the number of screens is different to what Kephal returns. for( int screen = 0; - screen < qApp->desktop()->numScreens(); + screen < Kephal::ScreenUtils::numScreens(); ++screen ) { // test top-left and bottom-right of every screen - ret.append( qApp->desktop()->screenGeometry( screen ).topLeft()); - ret.append( qApp->desktop()->screenGeometry( screen ).bottomRight() + QPoint( -5 + 1, -1 + 1 ) + ret.append( Kephal::ScreenUtils::screenGeometry( screen ).topLeft()); + ret.append( Kephal::ScreenUtils::screenGeometry( screen ).bottomRight() + QPoint( -5 + 1, -1 + 1 ) + QPoint( -1, 0 )); // intentionally moved one up, since the source windows will be one down } return ret;