diff --git a/tabbox.cpp b/tabbox.cpp index b4eeca865b..ed3e85b73e 100644 --- a/tabbox.cpp +++ b/tabbox.cpp @@ -15,6 +15,9 @@ Copyright (C) 1999, 2000 Matthias Ettrich #include #include #include +#include +#include +#include // 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 ); }