From e50c6e482ef75dea8c5ccd50e39e54174d821f8d Mon Sep 17 00:00:00 2001 From: NamorNiradnug Date: Tue, 2 Aug 2022 22:52:24 +0300 Subject: [PATCH] fix repeating popdown --- src/panel/widgets/notifications/notification-center.cpp | 8 +++++++- src/panel/widgets/notifications/single-notification.cpp | 1 - 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/panel/widgets/notifications/notification-center.cpp b/src/panel/widgets/notifications/notification-center.cpp index 8938fa33..614cfe4d 100644 --- a/src/panel/widgets/notifications/notification-center.cpp +++ b/src/panel/widgets/notifications/notification-center.cpp @@ -46,7 +46,13 @@ void WayfireNotificationCenter::newNotification(Notification::id_type id) if (!popover_timeout.empty() || !popover->is_visible()) { popover_timeout.disconnect(); - popover_timeout = Glib::signal_timeout().connect([=]() -> bool { popover->popdown(); }, timeout * 1000); + popover_timeout = Glib::signal_timeout().connect( + [=] { + popover->popdown(); + popover_timeout.disconnect(); + return true; + }, + timeout * 1000); } popover->popup(); } diff --git a/src/panel/widgets/notifications/single-notification.cpp b/src/panel/widgets/notifications/single-notification.cpp index 732f9720..4a30a150 100644 --- a/src/panel/widgets/notifications/single-notification.cpp +++ b/src/panel/widgets/notifications/single-notification.cpp @@ -2,7 +2,6 @@ #include "daemon.hpp" #include #include -#include #include const static std::string FILE_PREFIX = "file://";