From 59fa15a185de298486309a99c81cf802a5426b90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Fri, 9 Jan 2004 15:32:37 +0000 Subject: [PATCH] Read correctly original size when doing partial unmaximalization. CCMAIL: 68106-done@bugs.kde.org svn path=/trunk/kdebase/kwin/; revision=278167 --- geometry.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/geometry.cpp b/geometry.cpp index 2c9988c6ee..f52fbc08b4 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -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;