diff --git a/src/app/qml/Main.qml b/src/app/qml/Main.qml index 6c5b0444e..c2cd7b98b 100644 --- a/src/app/qml/Main.qml +++ b/src/app/qml/Main.qml @@ -358,7 +358,11 @@ Kirigami.ApplicationWindow { user: user, connection: root.connection, }) as UserDetailDialog; - dialog.parent = QmlUtils.focusedWindowItem(); // Kirigami Dialogs overwrite the parent, so we need to set it again + // FIXME: The reason why we don't want the focusedWindowItem for the room null case (aka QR codes) is because it will parent it to the soon-to-be-destroyed window item. + // But this won't be a problem if we turn it into a Kirigami.Dialog or some other in-scene item, which it really should be. + if (room != null) { + dialog.parent = QmlUtils.focusedWindowItem(); // Kirigami Dialogs overwrite the parent, so we need to set it again + } dialog.open(); } diff --git a/src/app/roommanager.cpp b/src/app/roommanager.cpp index f77fc1e79..5ef75a6f9 100644 --- a/src/app/roommanager.cpp +++ b/src/app/roommanager.cpp @@ -209,9 +209,16 @@ void RoomManager::resolveResource(Uri uri, const QString &action) return; } - if (uri.type() == Uri::NonMatrix && action == "qr"_L1) { - Q_EMIT externalUrl(uri.toUrl()); - return; + if (action == "qr"_L1) { + if (uri.type() == Uri::NonMatrix) { + Q_EMIT externalUrl(uri.toUrl()); + return; + } + if (uri.type() != Uri::UserId) { + uri.setAction(QStringLiteral("join")); + } else { + uri.setAction(action); + } } // For matrix URIs: