From 20f980dff7d12771e7b8fe9bd786ebfc7e61f9ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Wed, 11 Sep 2002 13:02:54 +0000 Subject: [PATCH] Make sure also dialogs are not placed under toplevel menubar or Kicker at the top edge. svn path=/trunk/kdebase/kwin/; revision=177159 --- client.cpp | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/client.cpp b/client.cpp index 7d2575ed96..ab9eeca455 100644 --- a/client.cpp +++ b/client.cpp @@ -698,18 +698,6 @@ bool Client::manage( bool isMapped, bool doNotShow, bool isInitial ) if ( ( (xSizeHint.flags & PPosition) && !ignorePPosition ) || (xSizeHint.flags & USPosition) ) { placementDone = TRUE; - if ( windowType() == NET::Normal && !area.contains( geom.topLeft() ) && may_move ) { - int tx = geom.x(); - int ty = geom.y(); - if ( tx >= 0 && tx < area.x() ) - tx = area.x(); - if ( ty >= 0 && ty < area.y() ) - ty = area.y(); - if ( tx > area.right() || ty > area.bottom() ) - placementDone = FALSE; // weird, do not trust. - else - geom.moveTopLeft( QPoint( tx, ty ) ); - } } if ( (xSizeHint.flags & USSize) || (xSizeHint.flags & PSize) ) { // keep in mind that we now actually have a size :-) @@ -720,6 +708,21 @@ bool Client::manage( bool isMapped, bool doNotShow, bool isInitial ) geom.setSize( geom.size().expandedTo( QSize(xSizeHint.min_width, xSizeHint.min_height ) ) ); } + if ( ( windowType() == NET::Normal || windowType() == NET::Dialog || windowType() == NET::Unknown + || windowType() == NET::Menu ) + && !area.contains( geom.topLeft() ) && may_move ) { + int tx = geom.x(); + int ty = geom.y(); + if ( tx >= 0 && tx < area.x() ) + tx = area.x(); + if ( ty >= 0 && ty < area.y() ) + ty = area.y(); + if ( tx > area.right() || ty > area.bottom() ) + placementDone = FALSE; // weird, do not trust. + else + geom.moveTopLeft( QPoint( tx, ty ) ); + } + windowWrapper()->resize( geom.size() ); // the clever activate() trick is necessary activateLayout();