Set active Xinerama screen when moving.
svn path=/trunk/KDE/kdebase/workspace/; revision=662863
This commit is contained in:
parent
97b328de46
commit
02405eccd7
3 changed files with 18 additions and 0 deletions
|
@ -1707,6 +1707,7 @@ void Client::setGeometry( int x, int y, int w, int h, ForceGeometry_t force )
|
|||
sendSyntheticConfigureNotify();
|
||||
updateWindowRules();
|
||||
checkMaximizeGeometry();
|
||||
workspace()->checkActiveScreen( this );
|
||||
if( geom_before_block.size() != geom.size())
|
||||
{
|
||||
discardWindowPixmap();
|
||||
|
@ -1770,6 +1771,7 @@ void Client::plainResize( int w, int h, ForceGeometry_t force )
|
|||
sendSyntheticConfigureNotify();
|
||||
updateWindowRules();
|
||||
checkMaximizeGeometry();
|
||||
workspace()->checkActiveScreen( this );
|
||||
discardWindowPixmap();
|
||||
if( scene != NULL )
|
||||
scene->windowGeometryShapeChanged( this );
|
||||
|
@ -1797,6 +1799,7 @@ void Client::move( int x, int y, ForceGeometry_t force )
|
|||
sendSyntheticConfigureNotify();
|
||||
updateWindowRules();
|
||||
checkMaximizeGeometry();
|
||||
workspace()->checkActiveScreen( this );
|
||||
// client itself is not damaged
|
||||
addWorkspaceRepaint( geom_before_block );
|
||||
addWorkspaceRepaint( geom ); // trigger repaint of window's new location
|
||||
|
|
|
@ -1622,6 +1622,18 @@ int Workspace::activeScreen() const
|
|||
return qApp->desktop()->screenNumber( QCursor::pos());
|
||||
}
|
||||
|
||||
// check whether a client moved completely out of what's considered the active screen,
|
||||
// if yes, set a new active screen
|
||||
void Workspace::checkActiveScreen( const Client* c )
|
||||
{
|
||||
if( !options->xineramaEnabled )
|
||||
return;
|
||||
if( !c->isActive())
|
||||
return;
|
||||
if( !c->isOnScreen( active_screen ))
|
||||
active_screen = c->screen();
|
||||
}
|
||||
|
||||
QRect Workspace::screenGeometry( int screen ) const
|
||||
{
|
||||
if( !options->xineramaEnabled )
|
||||
|
@ -1651,6 +1663,8 @@ void Workspace::sendClientToScreen( Client* c, int screen )
|
|||
it != transients_stacking_order.end();
|
||||
++it )
|
||||
sendClientToScreen( *it, screen );
|
||||
if( c->isActive())
|
||||
active_screen = screen;
|
||||
}
|
||||
|
||||
void Workspace::setDesktopLayout(NET::Orientation o, int x, int y,NET::DesktopLayoutCorner c)
|
||||
|
|
|
@ -174,6 +174,7 @@ class Workspace : public QObject, public KDecorationDefines
|
|||
|
||||
int activeScreen() const;
|
||||
int numScreens() const;
|
||||
void checkActiveScreen( const Client* c );
|
||||
QRect screenGeometry( int screen ) const;
|
||||
int screenNumber( QPoint pos ) const;
|
||||
QWidget* desktopWidget();
|
||||
|
|
Loading…
Reference in a new issue