Ensure that Workspace::activeScreen() always returns a valid screen.

svn path=/trunk/KDE/kdebase/workspace/; revision=925358
This commit is contained in:
Lucas Murray 2009-02-13 06:35:54 +00:00
parent 1802e56d9b
commit 7af22d3d99

View file

@ -1665,13 +1665,14 @@ int Workspace::activeScreen() const
{
if( !options->xineramaEnabled )
return 0;
if( !options->activeMouseScreen )
{
if( activeClient() != NULL && !activeClient()->isOnScreen( active_screen ))
return activeClient()->screen();
return active_screen;
}
return Kephal::ScreenUtils::screenId( cursorPos());
int screen = -1;
if( options->activeMouseScreen )
screen = Kephal::ScreenUtils::screenId( cursorPos());
if( screen != -1 )
return screen;
if( activeClient() != NULL && !activeClient()->isOnScreen( active_screen ))
return activeClient()->screen();
return active_screen;
}
/**