[gnome-shell] tray: Fix handling of SYSTEM_TRAY_CANCEL_MESSAGE
- From: Vincent Untz <vuntz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] tray: Fix handling of SYSTEM_TRAY_CANCEL_MESSAGE
- Date: Tue, 1 Feb 2011 11:27:56 +0000 (UTC)
commit 8abbd5dacbf07e372f5c91ec526371dee2339079
Author: Vincent Untz <vuntz gnome org>
Date: Tue Feb 1 12:13:47 2011 +0100
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 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/src/tray/na-tray-manager.c b/src/tray/na-tray-manager.c
index 31e23bf..3af478e 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]