# HG changeset patch # User Mark Doliner # Date 1093145011 0 # Node ID 81a9ddc3f415727750daa1e2b054e56ef9f9454d # Parent d56f24cc4dada4dd9840874c0afd9a2b2f776ca9 [gaim-migrate @ 10684] See the ChangeLog. This is patch 1012676. It works around a WinGTK bug. committer: Tailor Script diff -r d56f24cc4dad -r 81a9ddc3f415 COPYRIGHT --- 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 diff -r d56f24cc4dad -r 81a9ddc3f415 ChangeLog.win32 --- 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) diff -r d56f24cc4dad -r 81a9ddc3f415 plugins/docklet/docklet.c --- 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"));