From: Manuel Nickschas Date: Wed, 14 Apr 2010 07:41:02 +0000 (+0200) Subject: Fix tray icon behavior for non-KDE StatusNotifier X-Git-Tag: 0.7-beta1~102 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=62c360e674f17146c6c52e874e854e24bab643b3 Fix tray icon behavior for non-KDE StatusNotifier Our workaround for QSystemTrayIcon activation misbehavior (clicking the bubble should NOT send two activation signals!) fails when using StatusNotifier instead, but only if KDE integration is disabled (wtf?). Turns out we don't get mouse events from the notifier then. Solution: only enable workaround when using the legacy tray icon. --- diff --git a/src/qtui/systemtray.h b/src/qtui/systemtray.h index 4a2a8059..a83d356f 100644 --- a/src/qtui/systemtray.h +++ b/src/qtui/systemtray.h @@ -64,6 +64,7 @@ public: virtual ~SystemTray(); virtual void init(); + inline Mode mode() const; inline State state() const; inline bool isAlerted() const; virtual inline bool isSystemTrayAvailable() const; @@ -93,7 +94,6 @@ protected slots: protected: virtual void setMode(Mode mode); - inline Mode mode() const; inline bool shouldBeVisible() const; virtual Icon stateIcon() const; diff --git a/src/qtui/systraynotificationbackend.cpp b/src/qtui/systraynotificationbackend.cpp index dade7081..cb409ae2 100644 --- a/src/qtui/systraynotificationbackend.cpp +++ b/src/qtui/systraynotificationbackend.cpp @@ -88,7 +88,8 @@ void SystrayNotificationBackend::close(uint notificationId) { void SystrayNotificationBackend::notificationActivated(uint notificationId) { if(!_blockActivation) { if(_notifications.count()) { - _blockActivation = true; // prevent double activation because both tray icon and bubble might send a signal + if(QtUi::mainWindow()->systemTray()->mode() == SystemTray::Legacy) + _blockActivation = true; // prevent double activation because both tray icon and bubble might send a signal if(!notificationId) notificationId = _notifications.count()? _notifications.last().notificationId : 0; emit activated(notificationId);