From 22b3584b8dcf3ac814fcee49e47de375180cdfab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Fri, 30 May 2008 11:45:15 +0000 Subject: [PATCH] When trying to keep a window fully inside an area, shrink if necessary and possible. svn path=/trunk/KDE/kdebase/workspace/; revision=814467 --- geometry.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/geometry.cpp b/geometry.cpp index 73773a394a..15c2220027 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -700,6 +700,11 @@ void Client::keepInArea( QRect area, bool partial ) area.setRight( qMax( area.right() + width() - 100, area.right())); area.setBottom( qMax( area.bottom() + height() - 100, area.bottom())); } + if( !partial ) + { // resize to fit into area + if( area.width() < width() || area.height() < height()) + resizeWithChecks( qMin( area.width(), width()), qMin( area.height(), height())); + } if ( geometry().right() > area.right() && width() < area.width() ) move( area.right() - width(), y() ); if ( geometry().bottom() > area.bottom() && height() < area.height() )