From 05f34e3f95783cf0ca88e0ed8ecddb113485e69a Mon Sep 17 00:00:00 2001 From: Cristian Tibirna Date: Sun, 19 Dec 1999 03:04:39 +0000 Subject: [PATCH] CT: the real fix. How the heck did this work? svn path=/trunk/kdebase/kwin/; revision=36903 --- workspace.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/workspace.cpp b/workspace.cpp index e98539d646..2fcfc1a73b 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -1072,8 +1072,8 @@ void Workspace::smartPlacement(Client* c){ if((*l)->isOnDesktop(currentDesktop()) && (*l) != desktop_client && !(*l)->isIconified() && (*l) != c ) { - xl = (*l)->x(); yt = (*l)->y(); - xr = xl + (*l)->height(); yb = yt + (*l)->width(); + xl = (*l)->x(); yt = (*l)->y(); + xr = xl + (*l)->width(); yb = yt + (*l)->height(); //if windows overlap, calc the overall overlapping if((cxl < xr) && (cxr > xl) && @@ -1117,22 +1117,22 @@ void Workspace::smartPlacement(Client* c){ if ( (*l)->isOnDesktop(currentDesktop()) && (*l) != desktop_client && !(*l)->isIconified() && (*l) != c ) { - xl = (*l)->x(); yt = (*l)->y(); - xr = xl + (*l)->height(); yb = yt + (*l)->width(); + xl = (*l)->x(); yt = (*l)->y(); + xr = xl + (*l)->width(); yb = yt + (*l)->height(); // if not enough room above or under the current tested client // determine the first non-overlapped x position - if( y < yb && yt < ch + y ) { + if( ( y < yb ) && ( yt < ch + y ) ) { - if( yb > x ) - possible = possible < yb ? possible : yb; + if( xr > x ) + possible = possible < xr ? possible : xr; if( xl - cw > x ) possible = possible < xl - cw ? possible : xl - cw; } } - x_optimal = x = possible; } + x = possible; } // ... else ==> not enough x dimension (overlap was wrong on horizontal) @@ -1148,8 +1148,8 @@ void Workspace::smartPlacement(Client* c){ if( (*l)->isOnDesktop( currentDesktop() ) && (*l) != desktop_client && (*l) != c && !c->isIconified() ) { - xl = (*l)->x(); yt = (*l)->y(); - xr = xl + (*l)->height(); yb = yt + (*l)->width(); + xl = (*l)->x(); yt = (*l)->y(); + xr = xl + (*l)->width(); yb = yt + (*l)->height(); if( yb > y) possible = possible < yb ? possible : yb; @@ -1157,8 +1157,8 @@ void Workspace::smartPlacement(Client* c){ if( yt - ch > y ) possible = possible < yt - ch ? possible : yt - ch; } - y_optimal = y = possible; } + y = possible; } } while( overlap != none && overlap != h_wrong );