From d40cbd887a026e693d820a14bb773faa4275ee4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Thu, 17 Jan 2008 15:44:21 +0000 Subject: [PATCH] Handle correctly the case when maximization changes in both direction in opposite ways. BUG: 153970 svn path=/trunk/KDE/kdebase/workspace/; revision=762644 --- geometry.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/geometry.cpp b/geometry.cpp index cba499bcdd..a44d8dffde 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -1910,9 +1910,14 @@ void Client::changeMaximize( bool vertical, bool horizontal, bool adjust ) GeometryUpdatesBlocker blocker( this ); - // maximing one way and unmaximizing the other way shouldn't happen - Q_ASSERT( !( vertical && horizontal ) - || ((( max_mode & MaximizeVertical ) != 0 ) == (( max_mode & MaximizeHorizontal ) != 0 ))); + // maximing one way and unmaximizing the other way shouldn't happen, + // so restore first and then maximize the other way + if( ( old_mode == MaximizeVertical && max_mode == MaximizeHorizontal ) + || ( old_mode == MaximizeHorizontal && max_mode == MaximizeVertical )) + { + changeMaximize( false, false, false ); // restore + } + QRect clientArea = workspace()->clientArea( MaximizeArea, this );