From d19516de5229b48a32c44d38b9f611789119e960 Mon Sep 17 00:00:00 2001 From: TheXception Date: Mon, 30 Jun 2008 01:51:18 +0000 Subject: fixed first-run window positions of wizard and mainwindow on multi-monitor systems git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@1968 17fca916-40b9-46aa-a4ea-0a15b648b75c --- src/modules/setup/setupwizard.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/modules/setup/setupwizard.cpp') diff --git a/src/modules/setup/setupwizard.cpp b/src/modules/setup/setupwizard.cpp index 200b4c25e..1c9895126 100644 --- a/src/modules/setup/setupwizard.cpp +++ b/src/modules/setup/setupwizard.cpp @@ -658,8 +658,11 @@ KviSetupWizard::~KviSetupWizard() void KviSetupWizard::showEvent(QShowEvent *e) { - int w = QApplication::desktop()->width(); - int h = QApplication::desktop()->height(); + int primary_screen = g_pApp->desktop()->primaryScreen(); + QRect r = g_pApp->desktop()->screenGeometry(primary_screen); + + int w = r.width(); + int h = r.height(); int ww = width(); int wh = height(); @@ -672,9 +675,7 @@ void KviSetupWizard::showEvent(QShowEvent *e) if(ww < 770)ww = 770; } - //wh = sizeHint().height(); - - setGeometry((w - ww) / 2,(h - wh) / 2,ww,wh); + setGeometry(r.left() + (w - ww) / 2, r.top() + (h - wh) / 2,ww,wh); KviTalWizard::showEvent(e); } -- cgit v1.3.1-10-gc9f91