From 41bcfe70ed2438a33f3055919b23e0dffbf39b5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Wed, 18 Feb 2004 16:57:52 +0000 Subject: [PATCH] With restricted movement, don't require 100 pixels to be visible if the window is not so wide. CCMAIL: 71111-done@bugs.kde.org svn path=/trunk/kdebase/kwin/; revision=289074 --- geometry.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/geometry.cpp b/geometry.cpp index 001b7629fe..f8dc483960 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -1782,8 +1782,8 @@ void Client::checkUnrestrictedMoveResize() int left_marge, right_marge, top_marge, bottom_marge, titlebar_marge; // restricted move/resize - keep at least part of the titlebar always visible // how much must remain visible when moved away in that direction - left_marge = 100 + border_right; - right_marge = 100 + border_left; + left_marge = KMIN( 100 + border_right, moveResizeGeom.width()); + right_marge = KMIN( 100 + border_left, moveResizeGeom.width()); // width/height change with opaque resizing, use the initial ones titlebar_marge = initialMoveResizeGeom.height(); top_marge = border_bottom; @@ -1858,8 +1858,8 @@ void Client::handleMoveResize( int x, int y, int x_root, int y_root ) else // restricted move/resize - keep at least part of the titlebar always visible { // how much must remain visible when moved away in that direction - left_marge = 100 + border_right; - right_marge = 100 + border_left; + left_marge = KMIN( 100 + border_right, moveResizeGeom.width()); + right_marge = KMIN( 100 + border_left, moveResizeGeom.width()); // width/height change with opaque resizing, use the initial ones titlebar_marge = initialMoveResizeGeom.height(); top_marge = border_bottom;