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;