From 0c493f88d8349fc15218ef79ef4c9059262852a7 Mon Sep 17 00:00:00 2001 From: miruka Date: Fri, 16 Aug 2019 14:44:45 -0400 Subject: [PATCH] Don't set alert if window already focused --- src/qml/Chat/Chat.qml | 1 + src/qml/event_handlers.js | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/qml/Chat/Chat.qml b/src/qml/Chat/Chat.qml index 41c5d816..d9515215 100644 --- a/src/qml/Chat/Chat.qml +++ b/src/qml/Chat/Chat.qml @@ -18,6 +18,7 @@ HPage { readonly property var roomInfo: Utils.getItem( modelSources[["Room", userId]] || [], "room_id", roomId ) || "waiting" + onRoomInfoChanged: { if (roomInfo.left) { // The room will most likely be gone on client restart diff --git a/src/qml/event_handlers.js b/src/qml/event_handlers.js index 78c1b120..3359e79d 100644 --- a/src/qml/event_handlers.js +++ b/src/qml/event_handlers.js @@ -7,7 +7,9 @@ function onExitRequested(exitCode) { function onAlertRequested(msec) { - window.alert(msec) + if (Qt.application.state != Qt.ApplicationActive) { + window.alert(msec) + } }