Fixed a bug with window placement in smart mode where windows are to heigh.

They get placed nicely now.

svn path=/trunk/kdebase/kwin/; revision=65162
This commit is contained in:
Thomas Zander 2000-09-25 09:23:04 +00:00
parent 93b4d2b95d
commit e0e632dfdf

View file

@ -14,7 +14,6 @@ Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
#include <qdatastream.h> #include <qdatastream.h>
#include <kapp.h> #include <kapp.h>
#include <dcopclient.h> #include <dcopclient.h>
#include <kdebug.h>
#include <kprocess.h> #include <kprocess.h>
#include <netwm.h> #include <netwm.h>
@ -1290,7 +1289,7 @@ void Workspace::smartPlacement(Client* c){
//loop over possible positions //loop over possible positions
do { do {
//test if enough room in x and y directions //test if enough room in x and y directions
if ( y + ch > maxRect.bottom() && ch <= maxRect.height() ) if ( y + ch > maxRect.bottom() && ch <= maxRect.height())
overlap = h_wrong; // this throws the algorithm to an exit overlap = h_wrong; // this throws the algorithm to an exit
else if( x + cw > maxRect.right() ) else if( x + cw > maxRect.right() )
overlap = w_wrong; overlap = w_wrong;
@ -1393,7 +1392,10 @@ void Workspace::smartPlacement(Client* c){
y = possible; y = possible;
} }
} }
while( overlap != none && overlap != h_wrong ); while( overlap != none && overlap != h_wrong && y< maxRect.bottom() );
if(ch>= maxRect.height() )
y_optimal=maxRect.top();
// place the window // place the window
c->move( x_optimal, y_optimal ); c->move( x_optimal, y_optimal );