From 7f04417ad5fe337c176b584187732915ef2be411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Tue, 11 Apr 2006 13:47:32 +0000 Subject: [PATCH] One more of "When a window resizes, first try to keep it inside its xinerama screen." svn path=/trunk/KDE/kdebase/workspace/; revision=528602 --- geometry.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/geometry.cpp b/geometry.cpp index 0b20fce842..e4307072fc 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -1248,7 +1248,21 @@ void Client::getWmNormalHints() { // update to match restrictions QSize new_size = adjustedSize(); if( new_size != size() && !isFullScreen()) + { + QRect orig_geometry = geometry(); resizeWithChecks( new_size ); + if( ( !isSpecialWindow() || isToolbar()) && !isFullScreen()) + { + // try to keep the window in its xinerama screen if possible, + // if that fails at least keep it visible somewhere + QRect area = workspace()->clientArea( MovementArea, this ); + if( area.contains( orig_geometry )) + keepInArea( area ); + area = workspace()->clientArea( WorkArea, this ); + if( area.contains( orig_geometry )) + keepInArea( area ); + } + } } updateAllowedActions(); // affects isResizeable() }