From a3442c1829f6aa0188b9b08b892c92eb78a6c446 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Tue, 6 Jun 2023 08:24:25 +0200 Subject: [PATCH] fix #973 --- src/librssguard/gui/systemtrayicon.cpp | 21 ++++++++++---------- src/librssguard/miscellaneous/feedreader.cpp | 4 +++- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/librssguard/gui/systemtrayicon.cpp b/src/librssguard/gui/systemtrayicon.cpp index b2be06235..f9808247f 100644 --- a/src/librssguard/gui/systemtrayicon.cpp +++ b/src/librssguard/gui/systemtrayicon.cpp @@ -15,12 +15,12 @@ TrayIconMenu::TrayIconMenu(const QString& title, QWidget* parent) : QMenu(title, parent) {} bool TrayIconMenu::event(QEvent* event) { - if (event->type() == QEvent::Type::Show && Application::activeModalWidget() != nullptr) { + if (event->type() == QEvent::Type::Show && QApplication::activeModalWidget() != nullptr) { QTimer::singleShot(0, this, &TrayIconMenu::hide); - qApp->showGuiMessage(Notification::Event::GeneralEvent, { - tr("Close dialogs"), - tr("Close opened modal dialogs first."), - QSystemTrayIcon::MessageIcon::Warning }); + qApp->showGuiMessage(Notification::Event::GeneralEvent, + {tr("Close dialogs"), + tr("Close opened modal dialogs first."), + QSystemTrayIcon::MessageIcon::Warning}); } return QMenu::event(event); @@ -29,9 +29,7 @@ bool TrayIconMenu::event(QEvent* event) { #endif SystemTrayIcon::SystemTrayIcon(const QString& normal_icon, const QString& plain_icon, FormMain* parent) - : QSystemTrayIcon(parent), - m_normalIcon(normal_icon), - m_plainPixmap(plain_icon) { + : QSystemTrayIcon(parent), m_normalIcon(normal_icon), m_plainPixmap(plain_icon) { qDebugNN << LOGSEC_GUI << "Creating SystemTrayIcon instance."; m_font.setBold(true); @@ -150,8 +148,11 @@ void SystemTrayIcon::setNumber(int number, bool any_feed_has_new_unread_messages } } -void SystemTrayIcon::showMessage(const QString& title, const QString& message, QSystemTrayIcon::MessageIcon icon, - int milliseconds_timeout_hint, const std::function& functor) { +void SystemTrayIcon::showMessage(const QString& title, + const QString& message, + QSystemTrayIcon::MessageIcon icon, + int milliseconds_timeout_hint, + const std::function& functor) { if (m_connection != nullptr) { // Disconnect previous bubble click signalling. disconnect(m_connection); diff --git a/src/librssguard/miscellaneous/feedreader.cpp b/src/librssguard/miscellaneous/feedreader.cpp index 0808a7afe..ee33e892a 100644 --- a/src/librssguard/miscellaneous/feedreader.cpp +++ b/src/librssguard/miscellaneous/feedreader.cpp @@ -285,7 +285,9 @@ MessagesModel* FeedReader::messagesModel() const { } void FeedReader::executeNextAutoUpdate() { - bool disable_update_with_window = qApp->mainFormWidget()->isActiveWindow() && m_globalAutoUpdateOnlyUnfocused; + bool disable_update_with_window = + (qApp->mainFormWidget()->isActiveWindow() || QApplication::activeModalWidget() != nullptr) && + m_globalAutoUpdateOnlyUnfocused; auto roots = qApp->feedReader()->feedsModel()->serviceRoots(); std::list full_caches = boolinq::from(roots) .select([](ServiceRoot* root) -> CacheForServiceRoot* {