blackies patch to fix the tabbox position for dual screens setups

svn path=/trunk/kdebase/kwin/; revision=130535
This commit is contained in:
Matthias Elter 2002-01-08 10:33:05 +00:00
parent 3cba456ff4
commit 1f02fc2275

View file

@ -15,6 +15,9 @@ Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
#include <kglobal.h>
#include <kconfig.h>
#include <klocale.h>
#include <qapplication.h>
#include <qdesktopwidget.h>
#include <qcursor.h>
// specify externals before namespace
@ -89,10 +92,17 @@ void TabBox::reset()
desk = workspace()->currentDesktop();
}
int w = QMAX( wmax + 20, qApp->desktop()->width()/3 );
setGeometry( (qApp->desktop()->width()-w)/2,
qApp->desktop()->height()/2-fontMetrics().height()*2-10,
QDesktopWidget* desktop = qApp->desktop();
int screen = desktop->screenNumber( QCursor::pos() );
QRect r = desktop->screenGeometry(screen);
int w = QMAX( wmax + 20, r.width()/3 );
setGeometry( (r.width()-w)/2 + r.x(),
r.height()/2-fontMetrics().height()*2-10 + r.y(),
w, fontMetrics().height()*4 + 20 );
wmax = QMIN( wmax, width() - 12 );
}