reenabled maximize smartness

svn path=/trunk/kdebase/kwin/; revision=83642
This commit is contained in:
Matthias Ettrich 2001-02-19 12:17:03 +00:00
parent aa219e51db
commit 5651bcb69d

View file

@ -711,27 +711,26 @@ bool Client::manage( bool isMapped, bool doNotShow, bool isInitial )
else if ( info->state() & NET::MaxHoriz ) else if ( info->state() & NET::MaxHoriz )
maximize( Client::MaximizeHorizontal ); maximize( Client::MaximizeHorizontal );
/* if ( isMaximizable() && !isMaximized()
if ( isMaximizable() && !isMaximized()
&& ( width() >= area.width() || height() >= area.height() ) ) { && ( width() >= area.width() || height() >= area.height() ) ) {
// window is too large for the screen, maximize in the // window is too large for the screen, maximize in the
// directions necessary and generate a suitable restore // directions necessary and generate a suitable restore
// geometry. // geometry.
QSize s = adjustedSize( QSize( width()*2/3, height()*2/3 ) ); QSize s = adjustedSize( QSize( area.width()*2/3, area.height()*2/3 ) );
if ( width() >= area.width() && height() >= area.height() ) { if ( width() >= area.width() && height() >= area.height() ) {
maximize( Client::MaximizeFull ); maximize( Client::MaximizeFull );
geom_restore.setSize( s ); geom_restore.setSize( s );
geom_restore.moveCenter( geometry().center() ); geom_restore.moveCenter( geometry().center() );
} else if ( width() >= area.width() ) { } else if ( width() >= area.width() ) {
maximize( Client::MaximizeHorizontal ); maximize( Client::MaximizeHorizontal );
geom_restore.setWidth( s.width() ); geom_restore.setWidth( s.width() );
geom_restore.moveCenter( geometry().center() ); geom_restore.moveCenter( geometry().center() );
} else if ( height() >= area.height() ) { } else if ( height() >= area.height() ) {
maximize( Client::MaximizeVertical ); maximize( Client::MaximizeVertical );
geom_restore.setHeight( s.height() ); geom_restore.setHeight( s.height() );
geom_restore.moveCenter( geometry().center() ); geom_restore.moveCenter( geometry().center() );
} }
}*/ }
} }
delete session; delete session;
@ -1072,15 +1071,14 @@ bool Client::configureRequest( XConfigureRequestEvent& e )
nh = e.height; nh = e.height;
QSize ns = sizeForWindowSize( QSize( nw, nh ) ); QSize ns = sizeForWindowSize( QSize( nw, nh ) );
QRect area = workspace()->clientArea(); //QRect area = workspace()->clientArea();
if ( isMaximizable() && isMaximized() if ( isMaximizable() && isMaximized() ) { //&& ( ns.width() < area.width() || ns.height() < area.height() ) ) {
&& ( ns.width() < area.width() || ns.height() < area.height() ) ) { geom_restore.setSize( ns );
geom_restore.setSize( ns ); maximize( Client::MaximizeRestore );
maximize( Client::MaximizeRestore );
} else if ( !isMaximized() ) { } else if ( !isMaximized() ) {
if ( ns == size() ) if ( ns == size() )
return TRUE; // broken xemacs stuff (ediff) return TRUE; // broken xemacs stuff (ediff)
resize( ns ); resize( ns );
} }
} }