Date: Tuesday, February 21, 2017 @ 05:05:56 Author: bgyorgy Revision: 213242
upgpkg: quassel 0.12.4-3 Fix handling systray notifications (affects quassel-client-small only) Added: quassel/trunk/0001-Fix-handling-systray-notifications.patch Modified: quassel/trunk/PKGBUILD -----------------------------------------------+ 0001-Fix-handling-systray-notifications.patch | 56 ++++++++++++++++++++++++ PKGBUILD | 8 +++ 2 files changed, 63 insertions(+), 1 deletion(-) Added: 0001-Fix-handling-systray-notifications.patch =================================================================== --- 0001-Fix-handling-systray-notifications.patch (rev 0) +++ 0001-Fix-handling-systray-notifications.patch 2017-02-21 05:05:56 UTC (rev 213242) @@ -0,0 +1,56 @@ +From 38112a9e19283aa6768df9af14503ccbe09fe5b0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Gy=C3=B6rgy=20Ball=C3=B3?= <[email protected]> +Date: Thu, 16 Feb 2017 08:41:08 +0100 +Subject: [PATCH] Fix handling systray notifications + +Only toggle/activate the main window if the notification message comes from quassel. + +This fixes the problem that Quassel's main window is opened when the user clicks on any notification bubbles from other applications. +--- + src/qtui/systraynotificationbackend.cpp | 22 +++++++++++++--------- + 1 file changed, 13 insertions(+), 9 deletions(-) + +diff --git a/src/qtui/systraynotificationbackend.cpp b/src/qtui/systraynotificationbackend.cpp +index b0b7be62..d96000e1 100644 +--- a/src/qtui/systraynotificationbackend.cpp ++++ b/src/qtui/systraynotificationbackend.cpp +@@ -92,15 +92,16 @@ void SystrayNotificationBackend::close(uint notificationId) + void SystrayNotificationBackend::notificationActivated(uint notificationId) + { + if (!_blockActivation) { +- if (_notifications.count()) { +- 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); ++ QList<Notification>::iterator i = _notifications.begin(); ++ while (i != _notifications.end()) { ++ if (i->notificationId == notificationId) { ++ if (QtUi::mainWindow()->systemTray()->mode() == SystemTray::Legacy) ++ _blockActivation = true; // prevent double activation because both tray icon and bubble might send a signal ++ emit activated(notificationId); ++ break; ++ } ++ ++i; + } +- else +- GraphicalUi::toggleMainWidget(); + } + } + +@@ -108,7 +109,10 @@ void SystrayNotificationBackend::notificationActivated(uint notificationId) + void SystrayNotificationBackend::notificationActivated(SystemTray::ActivationReason reason) + { + if (reason == SystemTray::Trigger) { +- notificationActivated(0); ++ if (_notifications.count()) ++ notificationActivated(_notifications.last().notificationId); ++ else ++ GraphicalUi::toggleMainWidget(); + } + } + +-- +2.11.1 + Modified: PKGBUILD =================================================================== --- PKGBUILD 2017-02-21 04:25:44 UTC (rev 213241) +++ PKGBUILD 2017-02-21 05:05:56 UTC (rev 213242) @@ -5,7 +5,7 @@ pkgbase=quassel pkgname=('quassel-core' 'quassel-client' 'quassel-client-small' 'quassel-monolithic') pkgver=0.12.4 -pkgrel=2 +pkgrel=3 pkgdesc="Next-generation distributed IRC client" arch=('i686' 'x86_64') url="http://quassel-irc.org/" @@ -14,9 +14,11 @@ 'knotifyconfig' 'cmake' 'extra-cmake-modules' 'python' 'hicolor-icon-theme') source=(http://quassel-irc.org/pub/$pkgbase-$pkgver.tar.bz2 + 0001-Fix-handling-systray-notifications.patch $pkgbase.service $pkgbase.conf) sha256sums=('93e4e54cb3743cbe2e5684c2fcba94fd2bc2cd739f7672dee14341b49c29444d' + '5a465f33c5f233983a12139a1a121665c4ddab9e205997daa453dcffd255156a' '5dbe20290f3361b9b7a74a52905137e76b656976febf2d31082a2276f9dcde7f' 'f3031ea8217e01ba42cea14606169e3e27affa5918968ffd5a03c21ae92fe2b8') @@ -24,6 +26,10 @@ cd "${srcdir}" mkdir build-{core,client,client-small,mono} cd quassel-${pkgver} + + # Fix handling systray notifications + # https://github.com/quassel/quassel/pull/272 + patch -Np1 -i ../0001-Fix-handling-systray-notifications.patch } _build() (
