smarter placement (avoids having dialogs being truncated)

svn path=/trunk/kdebase/kwin/; revision=61618
icc-effect-5.14.5
Matthias Ettrich 2000-08-21 17:37:10 +00:00
parent d0d3166d4a
commit 20c1ac608a
1 changed files with 10 additions and 6 deletions

View File

@ -62,8 +62,6 @@ public:
state &= mask; // for safety, clear all other bits
if ( mask & NET::Sticky )
m_client->setSticky( state & NET::Sticky );
if ( mask & NET::Shaded )
m_client->setShade( state & NET::Shaded );
@ -490,12 +488,13 @@ bool Client::manage( bool isMapped, bool doNotShow )
if ( session )
geom.setRect( session->x, session->y, session->width, session->height );
QRect area = workspace()->clientArea();
if ( isMapped || session || isTransient() ) {
placementDone = TRUE;
if ( geom == workspace()->geometry() )
may_move = FALSE; // don't let fullscreen windows be moved around
} else {
QRect area = workspace()->clientArea();
if ( (xSizeHint.flags & PPosition) || (xSizeHint.flags & USPosition) ) {
placementDone = TRUE;
if ( windowType() == NET::Normal && !area.contains( geom.topLeft() ) ) {
@ -529,10 +528,15 @@ bool Client::manage( bool isMapped, bool doNotShow )
move( geom.x(), geom.y() );
gravitate( FALSE );
if ( !placementDone ) {
workspace()->doPlacement( this );
placementDone = TRUE;
} else if ( windowType() == NET::Normal ) {
if ( geometry().right() > area.right() && width() < area.width() )
move( area.right() - width(), y() );
if ( geometry().bottom() > area.bottom() && height() < area.height() )
move( x(), area.bottom() - height() );
}
if ( (is_shape = Shape::hasShape( win )) ) {
@ -563,7 +567,7 @@ bool Client::manage( bool isMapped, bool doNotShow )
// same window as its parent. this is necessary when an application
// starts up on a different desktop than is currently displayed
//
if ( isTransient() )
if ( isTransient() && !mainClient()->isSticky() )
desk = mainClient()->desktop();
if ( desk <= 0 ) {
@ -623,7 +627,7 @@ void Client::getWmNormalHints()
long msize;
if (XGetWMNormalHints(qt_xdisplay(), win, &xSizeHint, &msize) == 0 )
xSizeHint.flags = 0;
}
/*!