Prevent recursion loop in Toplevel::screen() and

Workspace::activeScreen() when the center of the active client is
offscreen and was not previously on the active screen.

svn path=/trunk/KDE/kdebase/workspace/; revision=925362
This commit is contained in:
Lucas Murray 2009-02-13 06:59:34 +00:00
parent 7af22d3d99
commit b55115a8be
3 changed files with 4 additions and 4 deletions

View file

@ -346,7 +346,7 @@ int Toplevel::screen() const
if( s < 0 )
// Center of the window is offscreen, just use the active one as if this window is the
// one with input focus then activeScreen() will return the screen it used to be on.
return workspace()->activeScreen();
return workspace()->activeScreen( false );
return s;
}

View file

@ -1661,7 +1661,7 @@ int Workspace::numScreens() const
return Kephal::ScreenUtils::numScreens();
}
int Workspace::activeScreen() const
int Workspace::activeScreen( bool checkClient ) const
{
if( !options->xineramaEnabled )
return 0;
@ -1670,7 +1670,7 @@ int Workspace::activeScreen() const
screen = Kephal::ScreenUtils::screenId( cursorPos());
if( screen != -1 )
return screen;
if( activeClient() != NULL && !activeClient()->isOnScreen( active_screen ))
if( activeClient() != NULL && !activeClient()->isOnScreen( active_screen ) && checkClient )
return activeClient()->screen();
return active_screen;
}

View file

@ -172,7 +172,7 @@ class Workspace : public QObject, public KDecorationDefines
int desktopUp( int desktop, bool wrap ) const;
int desktopDown( int desktop, bool wrap ) const;
int activeScreen() const;
int activeScreen( bool checkClient = true ) const;
int numScreens() const;
void checkActiveScreen( const Client* c );
void setActiveScreenMouse( const QPoint& mousepos );