From cc6e98cec980480757d17504771caec1a1f3b620 Mon Sep 17 00:00:00 2001 From: Lucas Murray Date: Wed, 27 Aug 2008 14:50:10 +0000 Subject: [PATCH] If restoring a window that was maximized on a different screen don't restore to the old screen. BUG: 169928 svn path=/trunk/KDE/kdebase/workspace/; revision=853323 --- geometry.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/geometry.cpp b/geometry.cpp index 2b13cbd7c5..0439e6ed48 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -2108,7 +2108,7 @@ void Client::changeMaximize( bool vertical, bool horizontal, bool adjust ) { if( old_mode & MaximizeHorizontal ) // actually restoring from MaximizeFull { - if( geom_restore.width() == 0 ) + if( geom_restore.width() == 0 || !clientArea.contains( geom_restore.center() )) { // needs placement plainResize( adjustedSize( QSize( width() * 2 / 3, clientArea.height()), SizemodeFixedH ), geom_mode ); workspace()->placeSmart( this, clientArea ); @@ -2132,7 +2132,7 @@ void Client::changeMaximize( bool vertical, bool horizontal, bool adjust ) { if( old_mode & MaximizeVertical ) // actually restoring from MaximizeFull { - if( geom_restore.height() == 0 ) + if( geom_restore.height() == 0 || !clientArea.contains( geom_restore.center() ) ) { // needs placement plainResize( adjustedSize( QSize( clientArea.width(), height() * 2 / 3 ), SizemodeFixedW ), geom_mode ); workspace()->placeSmart( this, clientArea ); @@ -2182,6 +2182,8 @@ void Client::changeMaximize( bool vertical, bool horizontal, bool adjust ) restore.moveTop( geom_restore.y()); } setGeometry( restore, geom_mode ); + if( !clientArea.contains( geom_restore.center() )) // Not restoring to the same screen + workspace()->place( this, clientArea ); info->setState( 0, NET::Max ); break; }