diff options
author | ckamm <mail@ckamm.de> | 2016-09-23 11:44:54 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-23 11:44:54 +0300 |
commit | 98efb075357fa64f424070e723db1786faa89d25 (patch) | |
tree | 15b4e72a0353dcad5064d19b1eb1e79877a1c088 /src/gui/owncloudgui.h | |
parent | bc04f7995979ce79b3d95022fac2fbaf4db922be (diff) |
Tray: Workaround collection (#5179)
Tray: Workaround collection
* QDBus workaround for Qt 5.5.0 only, there were reports of the tray
working fine with 5.5.1. #5164
* OWNCLOUD_FORCE_QDBUS_TRAY_WORKAROUND to force the workaround on an off
* OWNCLOUD_TRAY_UPDATE_WHILE_VISIBLE to enable or disable updating of
the menu while it's visible - disable by default due to problems on OSX and Xubuntu.
* Track the visibility of the tray menu with aboutToShow/aboutToHide
only on OSX - the aboutToHide signal doesn't trigger reliably on linux
* Refactor such that setupContextMenu is different from updateContextMenu
* Don't use on-demand updating of the tray menu when the qdbus workaround
is active, instead to occasional (30s) updates of the tray menu.
Diffstat (limited to 'src/gui/owncloudgui.h')
-rw-r--r-- | src/gui/owncloudgui.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/gui/owncloudgui.h b/src/gui/owncloudgui.h index 682944cb5..938158d8a 100644 --- a/src/gui/owncloudgui.h +++ b/src/gui/owncloudgui.h @@ -24,6 +24,7 @@ #include <QMenu> #include <QSignalMapper> #include <QSize> +#include <QTimer> namespace OCC { @@ -52,12 +53,16 @@ public: static QSize settingsDialogSize() { return QSize(800, 500); } void setupOverlayIcons(); + /// Whether the tray menu is visible + bool contextMenuVisible() const; + signals: void setupProxy(); public slots: void setupContextMenu(); - void setupContextMenuIfVisible(); + void updateContextMenu(); + void updateContextMenuNeeded(); void slotContextMenuAboutToShow(); void slotContextMenuAboutToHide(); void slotComputeOverallSyncStatus(); @@ -104,11 +109,15 @@ private: QPointer<LogBrowser>_logBrowser; // tray's menu QScopedPointer<QMenu> _contextMenu; - bool _contextMenuVisible; + + // Manually tracking whether the context menu is visible, but only works + // on OSX because aboutToHide is not reliable everywhere. + bool _contextMenuVisibleOsx; QMenu *_recentActionsMenu; QVector<QMenu*> _accountMenus; bool _qdbusmenuWorkaround; + QTimer _workaroundBatchTrayUpdate; QMap<QString, QPointer<ShareDialog> > _shareDialogs; QAction *_actionLogin; |