From 8abbd5dacbf07e372f5c91ec526371dee2339079 Mon Sep 17 00:00:00 2001 From: Vincent Untz Date: Tue, 1 Feb 2011 12:13:47 +0100 Subject: [PATCH] tray: Fix handling of SYSTEM_TRAY_CANCEL_MESSAGE We were not looking at the right field for the message ID: the ID is in the 4th field for BEGIN_MESSAGE, but 2nd field for CANCEL_MESSAGE. --- src/tray/na-tray-manager.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/tray/na-tray-manager.c b/src/tray/na-tray-manager.c index 31e23bf03..3af478e17 100644 --- a/src/tray/na-tray-manager.c +++ b/src/tray/na-tray-manager.c @@ -374,13 +374,17 @@ na_tray_manager_handle_begin_message (NaTrayManager *manager, if (!socket) return; + timeout = xevent->data.l[2]; + len = xevent->data.l[3]; + id = xevent->data.l[4]; + /* Check if the same message is already in the queue and remove it if so */ for (p = manager->messages; p; p = p->next) { PendingMessage *pmsg = p->data; if (xevent->window == pmsg->window && - xevent->data.l[4] == pmsg->id) + id == pmsg->id) { /* Hmm, we found it, now remove it */ pending_message_free (pmsg); @@ -390,10 +394,6 @@ na_tray_manager_handle_begin_message (NaTrayManager *manager, } } - timeout = xevent->data.l[2]; - len = xevent->data.l[3]; - id = xevent->data.l[4]; - if (len == 0) { g_signal_emit (manager, manager_signals[MESSAGE_SENT], 0, @@ -420,6 +420,9 @@ na_tray_manager_handle_cancel_message (NaTrayManager *manager, { GList *p; GtkSocket *socket; + long id; + + id = xevent->data.l[2]; /* Check if the message is in the queue and remove it if so */ for (p = manager->messages; p; p = p->next) @@ -427,7 +430,7 @@ na_tray_manager_handle_cancel_message (NaTrayManager *manager, PendingMessage *msg = p->data; if (xevent->window == msg->window && - xevent->data.l[4] == msg->id) + id == msg->id) { pending_message_free (msg); manager->messages = g_list_remove_link (manager->messages, p);