Skip to content

Commit

Permalink
systray: Do not emit notifications when the main window is active
Browse files Browse the repository at this point in the history
It is natural not to disturb the user in this case, since his attention
is already focused on the application. In addition, it allows to filter
notifications when the number of unread messages decreases.
  • Loading branch information
Tamaranch committed Jan 29, 2022
1 parent 6e6d40e commit 6968f4f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/systemtrayicon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void SystemTrayIcon::unreadStatsChanged(Quotient::Room* room)
const auto mode = Settings().get<QString>("UI/notifications", "intrusive");
if (mode == "none")
return;
if( room->notificationCount() > 0 ) {
if (qApp->activeWindow() != nullptr && room->notificationCount() > 0) {
showMessage(
//: %1 is the room display name
tr("Notification in %1").arg(room->displayName()),
Expand Down

0 comments on commit 6968f4f

Please sign in to comment.