changeset 9813:81a9ddc3f415

[gaim-migrate @ 10684] See the ChangeLog. This is patch 1012676. It works around a WinGTK bug. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 22 Aug 2004 03:23:31 +0000
parents d56f24cc4dad
children aaef48dc13a9
files COPYRIGHT ChangeLog.win32 plugins/docklet/docklet.c
diffstat 3 files changed, 29 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/COPYRIGHT	Sun Aug 22 03:06:33 2004 +0000
+++ b/COPYRIGHT	Sun Aug 22 03:23:31 2004 +0000
@@ -57,6 +57,7 @@
 Decklin Foster
 Adam Fritzler
 Max G.
+François Gagné
 Evgueni V. Gavrilov
 Ignacy Gawedzki
 Michael Golden
--- a/ChangeLog.win32	Sun Aug 22 03:06:33 2004 +0000
+++ b/ChangeLog.win32	Sun Aug 22 03:23:31 2004 +0000
@@ -1,4 +1,6 @@
 version 0.82:
+	* Selecting away messages using the system tray icon works
+	  (Thanks François Gagné)
 
 version 0.81 (08/05/2004):
 	* Napster joins binary release (Thanks Kevin)
--- a/plugins/docklet/docklet.c	Sun Aug 22 03:06:33 2004 +0000
+++ b/plugins/docklet/docklet.c	Sun Aug 22 03:23:31 2004 +0000
@@ -85,6 +85,24 @@
 }
 
 #ifdef _WIN32
+/* This is workaround for a bug in windows GTK+. Clicking outside of the
+   parent menu (including on a submenu-item) close the whole menu before
+   the "activate" event is thrown for the given submenu-item. Fixed by
+   replacing "activate" by "button-release-event". */
+static gboolean
+docklet_menu_do_away_message(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
+{
+	do_away_message(widget, user_data);
+	return FALSE;
+}
+
+static gboolean
+docklet_menu_create_away_mess(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
+{
+	create_away_mess(widget, user_data);
+	return FALSE;
+}
+
 /* This is a workaround for a bug in windows GTK+. Clicking outside of the
    menu does not get rid of it, so instead we get rid of it as soon as the
    pointer leaves the menu. */
@@ -138,7 +156,11 @@
 				a = (struct away_message *)awy->data;
 
 				entry = gtk_menu_item_new_with_label(a->name);
+#ifdef _WIN32
+				g_signal_connect(G_OBJECT(entry), "button-release-event", G_CALLBACK(docklet_menu_do_away_message), a);
+#else
 				g_signal_connect(G_OBJECT(entry), "activate", G_CALLBACK(do_away_message), a);
+#endif
 				gtk_menu_shell_append(GTK_MENU_SHELL(docklet_awaymenu), entry);
 
 				awy = g_slist_next(awy);
@@ -148,7 +170,11 @@
 				gaim_separator(docklet_awaymenu);
 
 			entry = gtk_menu_item_new_with_label(_("New..."));
+#ifdef _WIN32
+			g_signal_connect(G_OBJECT(entry), "button-release-event", G_CALLBACK(docklet_menu_create_away_mess), NULL);
+#else
 			g_signal_connect(G_OBJECT(entry), "activate", G_CALLBACK(create_away_mess), NULL);
+#endif
 			gtk_menu_shell_append(GTK_MENU_SHELL(docklet_awaymenu), entry);
 
 			entry = gtk_menu_item_new_with_label(_("Away"));