Read correctly original size when doing partial unmaximalization.

CCMAIL: 68106-done@bugs.kde.org

svn path=/trunk/kdebase/kwin/; revision=278167
This commit is contained in:
Luboš Luňák 2004-01-09 15:32:37 +00:00
parent 581fa5f585
commit 59fa15a185

View file

@ -1306,8 +1306,19 @@ void Client::changeMaximize( bool vertical, bool horizontal, bool adjust )
case MaximizeRestore:
{
QRect restore = geom_restore;
if( !geom_restore.isValid())
QRect restore = geometry();
// when only partially maximized, geom_restore may not have the other dimension remembered
if( old_mode & MaximizeVertical )
{
restore.setTop( geom_restore.top());
restore.setBottom( geom_restore.bottom());
}
if( old_mode & MaximizeHorizontal )
{
restore.setLeft( geom_restore.left());
restore.setRight( geom_restore.right());
}
if( !restore.isValid())
{
QSize s = QSize( clientArea.width()*2/3, clientArea.height()*2/3 );
if( geom_restore.width() > 0 )
@ -1322,17 +1333,6 @@ void Client::changeMaximize( bool vertical, bool horizontal, bool adjust )
if( geom_restore.height() > 0 )
restore.moveTop( geom_restore.y());
}
// when only partially maximized, geom_restore may not have the other dimension remembered
if(( old_mode & MaximizeHorizontal ) == 0 && restore.width() <= 0 )
{
restore.setLeft( x());
restore.setWidth( width());
}
if(( old_mode & MaximizeVertical ) == 0 && restore.height() <= 0 )
{
restore.setTop( y());
restore.setHeight( height());
}
setGeometry( restore );
info->setState( 0, NET::Max );
break;