close one notification to close all

This commit is contained in:
2026-02-02 21:46:50 +01:00
parent 49ac6cec90
commit ed1a9a8605
21 changed files with 352 additions and 146 deletions

View File

@@ -3,15 +3,13 @@
#include <memory>
#include "services/dbus/messages.hpp"
#include "widgets/notification/notification.hpp"
#include "widgets/notification/notificationWindow.hpp"
#include "widgets/notification/spotifyNotification.hpp"
#include "gdkmm/display.h"
#include "glibmm/main.h"
#define DEFAULT_NOTIFICATION_TIMEOUT 4000
std::shared_ptr<NotificationController> NotificationController::instance = nullptr;
NotificationController::NotificationController() {
@@ -60,7 +58,11 @@ void NotificationController::showNotificationOnAllMonitors(NotifyMessage notify)
notification->show();
// -1 means use default timeout, 0 means never expire
if (timeout <= 0) {
timeout = DEFAULT_NOTIFICATION_TIMEOUT; // default to 3 seconds
timeout = DEFAULT_NOTIFICATION_TIMEOUT;
}
if (timeout == 0) {
continue;
}
Glib::signal_timeout().connect([notification]() {