diff --git a/src/qml/Page/RoomPage.qml b/src/qml/Page/RoomPage.qml index 4b8c1b748..ecb519e27 100644 --- a/src/qml/Page/RoomPage.qml +++ b/src/qml/Page/RoomPage.qml @@ -77,7 +77,14 @@ Kirigami.ScrollablePage { Shortcut { sequence: StandardKey.Cancel - onActivated: applicationWindow().pageStack.get(0).forceActiveFocus() + onActivated: { + if (!messageListView.atYEnd || currentRoom.hasUnreadMessages) { + goToLastMessage(); + currentRoom.markAllMessagesAsRead(); + } else { + applicationWindow().pageStack.get(0).forceActiveFocus(); + } + } enabled: !page.disableCancelShortcut }