multi click not fucked
This commit is contained in:
@@ -84,6 +84,7 @@ void NotificationService::handle_notify(const Glib::VariantContainerBase ¶me
|
||||
notify.app_icon = app_icon;
|
||||
notify.summary = static_cast<std::string>(summary);
|
||||
notify.body = static_cast<std::string>(body);
|
||||
notify.actionInvoked = std::make_shared<bool>(false);
|
||||
|
||||
std::vector<std::string> actions_converted;
|
||||
actions_converted.reserve(actions.size());
|
||||
|
||||
@@ -93,7 +93,7 @@ void NotificationController::showSpotifyNotification(MprisPlayer2Message mpris)
|
||||
});
|
||||
|
||||
|
||||
notification->startAutoClose(10000);
|
||||
notification->startAutoClose(DEFAULT_NOTIFICATION_TIMEOUT);
|
||||
}
|
||||
|
||||
this->activeNotifications[id] = notifications;
|
||||
|
||||
@@ -88,8 +88,9 @@ NotificationWindow::NotificationWindow(uint64_t notificationId, std::shared_ptr<
|
||||
break;
|
||||
}
|
||||
|
||||
btn->signal_clicked().connect([this, action_id, cb = notify.on_action]() {
|
||||
if (cb) {
|
||||
btn->signal_clicked().connect([this, action_id, cb = notify.on_action, guard = notify.actionInvoked]() {
|
||||
if (cb && guard && !*guard) {
|
||||
*guard = true;
|
||||
cb(action_id);
|
||||
this->signal_close.emit(this->notificationId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user