diff --git a/popupinfo.cpp b/popupinfo.cpp index 61cd95879b..b9240fa03c 100644 --- a/popupinfo.cpp +++ b/popupinfo.cpp @@ -21,6 +21,7 @@ Copyright (C) 2002 Alexander Kellett #include #include #include +#include // specify externals before namespace @@ -51,18 +52,7 @@ PopupInfo::~PopupInfo() */ void PopupInfo::reset() { - QDesktopWidget* desktop = qApp->desktop(); - KConfig gc("kdeglobals", false, false); - gc.setGroup("Windows"); - QRect r; - if (QApplication::desktop()->isVirtualDesktop() && - gc.readBoolEntry("XineramaEnabled", true) && - gc.readBoolEntry("XineramaPlacementEnabled", true)) { - int screen = desktop->screenNumber( QCursor::pos() ); - r = desktop->screenGeometry(screen); - } else { - r = desktop->geometry(); - } + QRect r = KGlobalSettings::desktopGeometry(QCursor::pos()); int w = fontMetrics().width( m_infoString ) + 30; diff --git a/tabbox.cpp b/tabbox.cpp index fc3703d5fe..cd835a8ac0 100644 --- a/tabbox.cpp +++ b/tabbox.cpp @@ -19,6 +19,7 @@ Copyright (C) 1999, 2000 Matthias Ettrich #include #include #include +#include // specify externals before namespace @@ -94,19 +95,7 @@ void TabBox::reset() desk = workspace()->currentDesktop(); } - QDesktopWidget* desktop = qApp->desktop(); - QRect r; - KConfig gc("kdeglobals", false, false); - gc.setGroup("Windows"); - - if (QApplication::desktop()->isVirtualDesktop() && - gc.readBoolEntry("XineramaEnabled", true) && - gc.readBoolEntry("XineramaPlacementEnabled", true)) { - int screen = desktop->screenNumber( QCursor::pos() ); - r = desktop->screenGeometry(screen); - } else { - r = desktop->geometry(); - } + QRect r = KGlobalSettings::desktopGeometry(QCursor::pos()); int w = QMIN( QMAX( wmax + 20, r.width()/3 ), r.width() ); setGeometry( (r.width()-w)/2 + r.x(),