Use availableGeometry() to calculate the dialog position.

availableGeometry() excludes ares where windows can't be placed (e.g. panels).
This commit is contained in:
Felix Geyer 2015-11-01 23:26:40 +01:00
parent b02ec98ec6
commit 9e1ea264e2

View File

@ -43,7 +43,7 @@ AutoTypeSelectDialog::AutoTypeSelectDialog(QWidget* parent)
resize(size);
// move dialog to the center of the screen
QPoint screenCenter = QApplication::desktop()->screenGeometry(QCursor::pos()).center();
QPoint screenCenter = QApplication::desktop()->availableGeometry(QCursor::pos()).center();
move(screenCenter.x() - (size.width() / 2), screenCenter.y() - (size.height() / 2));
QVBoxLayout* layout = new QVBoxLayout(this);