smarter placement (avoids having dialogs being truncated)
svn path=/trunk/kdebase/kwin/; revision=61618
This commit is contained in:
parent
d0d3166d4a
commit
20c1ac608a
1 changed files with 10 additions and 6 deletions
12
client.cpp
12
client.cpp
|
@ -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() ) ) {
|
||||
|
@ -533,6 +532,11 @@ bool Client::manage( bool isMapped, bool doNotShow )
|
|||
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 ) {
|
||||
|
|
Loading…
Reference in a new issue