If a window has configured a specific position using window-specific settings,

don't force it to be entirely in the workarea, as long as at least something
is still visible.

svn path=/trunk/kdebase/kwin/; revision=370319
This commit is contained in:
Luboš Luňák 2004-12-13 11:40:25 +00:00
parent 832b0bce94
commit ded2656b03
3 changed files with 16 additions and 5 deletions

View file

@ -202,7 +202,7 @@ class Client : public QObject, public KDecorationDefines
// plainResize() simply resizes
void plainResize( int w, int h, ForceGeometry_t force = NormalGeometrySet );
void plainResize( const QSize& s, ForceGeometry_t force = NormalGeometrySet );
void keepInArea( const QRect& area );
void keepInArea( QRect area, bool partial = false );
void growHorizontal();
void shrinkHorizontal();

View file

@ -664,8 +664,16 @@ void Workspace::updateTopMenuGeometry( Client* c )
//********************************************
void Client::keepInArea( const QRect& area )
void Client::keepInArea( QRect area, bool partial )
{
if( partial )
{
// increase the area so that can have only 100 pixels in the area
area.setLeft( QMIN( area.left() - width() + 100, area.left()));
area.setTop( QMIN( area.top() - height() + 100, area.top()));
area.setRight( QMAX( area.right() + width() - 100, area.right()));
area.setBottom( QMAX( area.bottom() + height() - 100, area.bottom()));
}
if ( geometry().right() > area.right() && width() < area.width() )
move( area.right() - width(), y() );
if ( geometry().bottom() > area.bottom() && height() < area.height() )

View file

@ -190,6 +190,7 @@ bool Client::manage( Window w, bool isMapped )
geom = session->geometry;
QRect area;
bool partial_keep_in_area = isMapped || session;
if( isMapped || session )
area = workspace()->clientArea( FullArea, geom.center(), desktop());
else if( options->xineramaPlacementEnabled )
@ -274,6 +275,9 @@ bool Client::manage( Window w, bool isMapped )
{
move( forced_pos );
placementDone = true;
// don't keep inside workarea if the window has specially configured position
partial_keep_in_area = true;
area = workspace()->clientArea( FullArea, geom.center(), desktop());
}
if( !placementDone )
{ // placement needs to be after setting size
@ -281,9 +285,8 @@ bool Client::manage( Window w, bool isMapped )
placementDone = TRUE;
}
if( !isMapped && !session // trust position from session or if already mapped
&& ( !isSpecialWindow() || isToolbar()) && isMovable())
keepInArea( area );
if(( !isSpecialWindow() || isToolbar()) && isMovable())
keepInArea( area, partial_keep_in_area );
XShapeSelectInput( qt_xdisplay(), window(), ShapeNotifyMask );
if ( (is_shape = Shape::hasShape( window())) )