From b41fc6bf49dd115953d4c9e9ac96779dcb76bdb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Thu, 15 Jan 2004 14:17:41 +0000 Subject: [PATCH] Don't try to center windows on special windows like standalone menubar. svn path=/trunk/kdebase/kwin/; revision=279904 --- placement.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/placement.cpp b/placement.cpp index 282f6e46ba..bce1b50e53 100644 --- a/placement.cpp +++ b/placement.cpp @@ -422,6 +422,7 @@ void Placement::placeOnMainWindow(Client* c, QRect& area ) area = checkArea( c, area ); ClientList mainwindows = c->mainClients(); Client* place_on = NULL; + Client* place_on2 = NULL; int mains_count = 0; for( ClientList::ConstIterator it = mainwindows.begin(); it != mainwindows.end(); @@ -430,6 +431,7 @@ void Placement::placeOnMainWindow(Client* c, QRect& area ) if( (*it)->isSpecialWindow() && !(*it)->isOverride()) continue; // don't consider toolbars etc when placing ++mains_count; + place_on2 = *it; if( (*it)->isOnCurrentDesktop()) { if( place_on == NULL ) @@ -448,13 +450,14 @@ void Placement::placeOnMainWindow(Client* c, QRect& area ) placeCentered( c, area ); return; } - place_on = mainwindows.first(); + place_on = place_on2; // use the only window filtered together with 'mains_count' } QRect geom = c->geometry(); geom.moveCenter( place_on->geometry().center()); c->move( geom.topLeft()); // get area again, because the mainwindow may be on different xinerama screen area = checkArea( c, QRect()); + c->keepInArea( area ); // make sure it's kept inside workarea } QRect Placement::checkArea( const Client* c, const QRect& area )