From 1f02fc2275f2a626bb9d4b9bcdab810fb3f6ebb4 Mon Sep 17 00:00:00 2001 From: Matthias Elter Date: Tue, 8 Jan 2002 10:33:05 +0000 Subject: [PATCH] blackies patch to fix the tabbox position for dual screens setups svn path=/trunk/kdebase/kwin/; revision=130535 --- tabbox.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) 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 ); }