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