diff --git a/src/plugin-accounts/qml/CreateAccountDialog.qml b/src/plugin-accounts/qml/CreateAccountDialog.qml index f8adcd708d..431dfdee51 100644 --- a/src/plugin-accounts/qml/CreateAccountDialog.qml +++ b/src/plugin-accounts/qml/CreateAccountDialog.qml @@ -14,17 +14,34 @@ import AccountsController 1.0 D.DialogWindow { id: dialog + property var transientParentWindow: null width: 460 minimumWidth: width minimumHeight: height maximumWidth: minimumWidth maximumHeight: minimumHeight icon: "preferences-system" + transientParent: transientParentWindow modality: Qt.WindowModal title: qsTr("Create a new account") signal accepted() + Component.onCompleted: { + transientParentWindow = Qt.application.activeWindow + } + + onVisibleChanged: { + if (!visible) + return + if (!transientParentWindow || transientParentWindow === dialog) + transientParentWindow = Qt.application.activeWindow + Qt.callLater(function () { + dialog.raise() + dialog.requestActivate() + }) + } + ColumnLayout { id: mainLayout width: dialog.width - 20