From 9eb9198bad79ba4c74c6965aa6577a97dc1965c8 Mon Sep 17 00:00:00 2001 From: dan Date: Thu, 18 Nov 1999 01:43:08 +0000 Subject: [PATCH] Fixed a problem in notification queuing (the coalescing was done wrong if both name and sender were specified). --- WINGs/notification.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/WINGs/notification.c b/WINGs/notification.c index 3c3e379b..a328d84a 100644 --- a/WINGs/notification.c +++ b/WINGs/notification.c @@ -434,7 +434,28 @@ WMDequeueNotificationMatching(WMNotificationQueue *queue, int i; WMNotification *tmp; - if (mask & WNCOnName) { + if ((mask & WNCOnName) && (mask & WNCOnSender)) { + for (i = 0; i < WMGetBagItemCount(queue->asapQueue); i++) { + tmp = WMGetFromBag(queue->asapQueue, i); + + if (notification->object == tmp->object && + strcmp(notification->name, tmp->name) == 0) { + WMRemoveFromBag(queue->asapQueue, tmp); + WMReleaseNotification(tmp); + break; + } + } + for (i = 0; i < WMGetBagItemCount(queue->idleQueue); i++) { + tmp = WMGetFromBag(queue->idleQueue, i); + + if (notification->object == tmp->object && + strcmp(notification->name, tmp->name) == 0) { + WMRemoveFromBag(queue->idleQueue, tmp); + WMReleaseNotification(tmp); + break; + } + } + } else if (mask & WNCOnName) { for (i = 0; i < WMGetBagItemCount(queue->asapQueue); i++) { tmp = WMGetFromBag(queue->asapQueue, i); @@ -453,8 +474,7 @@ WMDequeueNotificationMatching(WMNotificationQueue *queue, break; } } - } - if (mask & WNCOnSender) { + } else if (mask & WNCOnSender) { for (i = 0; i < WMGetBagItemCount(queue->asapQueue); i++) { tmp = WMGetFromBag(queue->asapQueue, i);