From bf8b966b5e2cfeabe47ef3f1c7517180f7448135 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Mon, 26 Oct 2015 18:24:55 -0200 Subject: [PATCH] Fix incorrect placement of the Settings Dialog on Multiple Monitors The current monitor used was the 'default' one, the primary monitor but if your default monitor was the laptop one, with the lid closed like mine was for quite a bit, you'd spend like 20 minutes trying to find the preferences dialog, like I did. Signed-off-by: Tomaz Canabrava --- src/ui/SettingsDialog.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ui/SettingsDialog.cc b/src/ui/SettingsDialog.cc index 46c53c153..ac5f6dbbb 100644 --- a/src/ui/SettingsDialog.cc +++ b/src/ui/SettingsDialog.cc @@ -47,8 +47,11 @@ _ui(new Ui::SettingsDialog) _ui->setupUi(this); // Center the window on the screen. + QDesktopWidget *desktop = QApplication::desktop(); + int screen = desktop->screenNumber(parent); + QRect position = frameGeometry(); - position.moveCenter(QApplication::desktop()->availableGeometry().center()); + position.moveCenter(QApplication::desktop()->availableGeometry(screen).center()); move(position.topLeft()); QGCLinkConfiguration* pLinkConf = new QGCLinkConfiguration(this); -- 2.22.0