diff --git a/ChangeLog b/ChangeLog index d4d58a8b1..5657b40e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ Bug fixes: - #6889 Systray Icon on Ubuntu Auto Start (take 2) - #6914 Fix for Qt Word Wrap on Mac - #6920 Windows Installer checksums +- #6921 Handling pre-main window creation status notifications Enhancements: - #6912 Removes UI for Screen Saver Sync and Files Drag and Drop @@ -14,7 +15,6 @@ Enhancements: - #6910 Don't use the word “Version” for release names because it can lead to errors during update checking. - #6918 Removing positional union initialisation - #6913 Create binaries and attach them to GitHub releases -=========== v1.13.0-stable =========== diff --git a/src/gui/src/TrayIcon.cpp b/src/gui/src/TrayIcon.cpp index aa494bd8c..f44cfa33c 100644 --- a/src/gui/src/TrayIcon.cpp +++ b/src/gui/src/TrayIcon.cpp @@ -12,8 +12,3 @@ void TrayIcon::tryCreate() const QTimer::singleShot(2500, this, &TrayIcon::tryCreate); } } - -void TrayIcon::set(const QIcon& icon) const -{ - m_pTrayIcon->setIcon(icon); -} diff --git a/src/gui/src/TrayIcon.h b/src/gui/src/TrayIcon.h index c708270c8..b9d515537 100644 --- a/src/gui/src/TrayIcon.h +++ b/src/gui/src/TrayIcon.h @@ -12,6 +12,15 @@ class TrayIcon : public QObject public: using TConnector = std::function; + TrayIcon() + { + m_set = [this](const QIcon &icon){ + m_init = [this,icon](){ + this->set(icon); + }; + }; + } + template void create(TActionContainer const &actionContainer, TConnector const &connector) { @@ -30,16 +39,22 @@ public: m_pTrayIcon = std::make_unique(); m_pTrayIcon->setContextMenu(m_pTrayIconMenu.get()); m_pTrayIcon->setToolTip("Synergy"); + m_set = [this](const QIcon& icon) { m_pTrayIcon->setIcon(icon); }; tryCreate(); + if (m_init) { + m_init(); + m_init = std::function(); + } } void tryCreate() const; - - void set(const QIcon& icon) const; + void set(const QIcon& icon) const { m_set(icon); } private: - std::unique_ptr m_pTrayIcon {}; - std::unique_ptr m_pTrayIconMenu {}; - TConnector m_connector; + std::unique_ptr m_pTrayIcon {}; + std::unique_ptr m_pTrayIconMenu {}; + TConnector m_connector; + std::function m_init; + std::function m_set; };