im.pidgin.pidgin: ec9312b334da1e6bba216d75fd71b700c8cac95b

sadrul at pidgin.im sadrul at pidgin.im
Fri Dec 21 14:31:21 EST 2007


-----------------------------------------------------------------
Revision: ec9312b334da1e6bba216d75fd71b700c8cac95b
Ancestor: 1f8afab1886606b0936e80a00245ff532d77086f
Author: sadrul at pidgin.im
Date: 2007-12-21T14:19:29
Branch: im.pidgin.pidgin

Modified files:
        pidgin/gtkaccount.c pidgin/gtkcertmgr.c pidgin/gtkconv.c
        pidgin/gtkdocklet-x11.c pidgin/gtkimhtmltoolbar.c
        pidgin/gtknotify.c pidgin/gtkrequest.c
        pidgin/gtkscrollbook.c pidgin/gtkstatusbox.c

ChangeLog: 

Make some more event handlers return appropriate gboolean values. This turns
out to be a pretty important thing to do. Not returning FALSE from a delete_event
callback would, for example, only hide a widget, instead of destroying it, which
can cause leaks.

-------------- next part --------------
============================================================
--- pidgin/gtkaccount.c	737b270c138edcccf41fa5895fd4ad0e0523577c
+++ pidgin/gtkaccount.c	2e6393eea89aa7f08bb44bffb18ab2e670d9b094
@@ -1108,7 +1108,7 @@ add_proxy_options(AccountPrefsDialog *di
 					 G_CALLBACK(proxy_type_changed_cb), dialog);
 }
 
-static void
+static gboolean
 account_win_destroy_cb(GtkWidget *w, GdkEvent *event,
 					   AccountPrefsDialog *dialog)
 {
@@ -1129,6 +1129,7 @@ account_win_destroy_cb(GtkWidget *w, Gdk
 	purple_signals_disconnect_by_handle(dialog);
 
 	g_free(dialog);
+	return FALSE;
 }
 
 static void
============================================================
--- pidgin/gtkcertmgr.c	92983dc52c9ebb8de4e725619b31acb5974d1ddb
+++ pidgin/gtkcertmgr.c	7773544db393806fae0414825700e1190059ef4e
@@ -545,12 +545,13 @@ CertMgrDialog *certmgr_dialog = NULL;
    So if it is set, don't open another one! */
 CertMgrDialog *certmgr_dialog = NULL;
 
-static void
+static gboolean
 certmgr_close_cb(GtkWidget *w, CertMgrDialog *dlg)
 {
 	/* TODO: Ignoring the arguments to this function may not be ideal,
 	   but there *should* only be "one dialog to rule them all" at a time*/
 	pidgin_certmgr_hide();
+	return FALSE;
 }
 
 void
============================================================
--- pidgin/gtkconv.c	f889d0e30e1e5daaff79eeeede5e67fb9812fa56
+++ pidgin/gtkconv.c	674064a04a50bd96afdcdba3a6b379665057773d
@@ -4579,11 +4579,12 @@ pidgin_conv_tooltip_timeout(PidginConver
 	return FALSE;
 }
 
-static void
+static gboolean
 pidgin_conv_leave_cb (GtkWidget *w, GdkEventCrossing *e, PidginConversation *gtkconv)
 {
 	pidgin_blist_tooltip_destroy();
 	reset_tooltip();
+	return FALSE;
 }
 
 static gboolean 
============================================================
--- pidgin/gtkdocklet-x11.c	68cc7f0172e70e80c04e4d1b45a54c4bf5c2bd80
+++ pidgin/gtkdocklet-x11.c	e39dd8dec333fa6e1f8796e4b2a891ee1d6f00d8
@@ -79,13 +79,14 @@ docklet_x11_destroyed_cb(GtkWidget *widg
 	g_idle_add(docklet_x11_recreate_cb, NULL);
 }
 
-static void
+static gboolean
 docklet_x11_clicked_cb(GtkWidget *button, GdkEventButton *event, void *data)
 {
 	if (event->type != GDK_BUTTON_RELEASE)
-		return;
+		return FALSE;
 
 	pidgin_docklet_clicked(event->button);
+	return TRUE;
 }
 
 static void
============================================================
--- pidgin/gtkimhtmltoolbar.c	7cbcc533df65b7d1059748f2ab5e5e46ae48e958
+++ pidgin/gtkimhtmltoolbar.c	0ba7e9401017b8fc03a0b87d3b5e27a6a10e5794
@@ -99,7 +99,7 @@ do_big(GtkWidget *large, GtkIMHtmlToolba
 	gtk_widget_grab_focus(toolbar->imhtml);
 }
 
-static void
+static gboolean
 destroy_toolbar_font(GtkWidget *widget, GdkEvent *event,
 					 GtkIMHtmlToolbar *toolbar)
 {
@@ -111,6 +111,7 @@ destroy_toolbar_font(GtkWidget *widget, 
 		gtk_widget_destroy(toolbar->font_dialog);
 		toolbar->font_dialog = NULL;
 	}
+	return FALSE;
 }
 
 static void
@@ -191,7 +192,7 @@ toggle_font(GtkWidget *font, GtkIMHtmlTo
 	gtk_widget_grab_focus(toolbar->imhtml);
 }
 
-static void
+static gboolean
 destroy_toolbar_fgcolor(GtkWidget *widget, GdkEvent *event,
 						GtkIMHtmlToolbar *toolbar)
 {
@@ -203,6 +204,7 @@ destroy_toolbar_fgcolor(GtkWidget *widge
 		gtk_widget_destroy(toolbar->fgcolor_dialog);
 		toolbar->fgcolor_dialog = NULL;
 	}
+	return FALSE;
 }
 
 static void cancel_toolbar_fgcolor(GtkWidget *widget,
@@ -263,7 +265,7 @@ toggle_fg_color(GtkWidget *color, GtkIMH
 	gtk_widget_grab_focus(toolbar->imhtml);
 }
 
-static void
+static gboolean
 destroy_toolbar_bgcolor(GtkWidget *widget, GdkEvent *event,
 						GtkIMHtmlToolbar *toolbar)
 {
@@ -279,6 +281,7 @@ destroy_toolbar_bgcolor(GtkWidget *widge
 		gtk_widget_destroy(toolbar->bgcolor_dialog);
 		toolbar->bgcolor_dialog = NULL;
 	}
+	return FALSE;
 }
 
 static void
@@ -575,11 +578,12 @@ destroy_smiley_dialog(GtkIMHtmlToolbar *
 	}
 }
 
-static void
+static gboolean
 close_smiley_dialog(GtkWidget *widget, GdkEvent *event,
 					GtkIMHtmlToolbar *toolbar)
 {
 	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toolbar->smiley), FALSE);
+	return FALSE;
 }
 
 
============================================================
--- pidgin/gtknotify.c	fcdecd5714ca8e71c1b407bff4450e06fda78810
+++ pidgin/gtknotify.c	1a76f8520e461e3eec1ed38571203af556d7d599
@@ -166,16 +166,18 @@ reset_mail_dialog(GtkDialog *dialog)
 	mail_dialog = NULL;
 }
 
-static void
+static gboolean
 formatted_close_cb(GtkWidget *win, GdkEvent *event, void *user_data)
 {
 	purple_notify_close(PURPLE_NOTIFY_FORMATTED, win);
+	return FALSE;
 }
 
-static void
+static gboolean
 searchresults_close_cb(PidginNotifySearchResultsData *data, GdkEvent *event, gpointer user_data)
 {
 	purple_notify_close(PURPLE_NOTIFY_SEARCHRESULTS, data);
+	return FALSE;
 }
 
 static void
============================================================
--- pidgin/gtkrequest.c	c4dd2359dd2b7c1c545aeca3b57db8fc72a9a238
+++ pidgin/gtkrequest.c	17234be0980aec6821f93c34bf87cd3e70ba9f0e
@@ -251,11 +251,12 @@ multifield_cancel_cb(GtkWidget *button, 
 	purple_request_close(PURPLE_REQUEST_FIELDS, data);
 }
 
-static void
+static gboolean
 destroy_multifield_cb(GtkWidget *dialog, GdkEvent *event,
 					  PidginRequestData *data)
 {
 	multifield_cancel_cb(NULL, data);
+	return FALSE;
 }
 
 
@@ -1505,7 +1506,7 @@ file_ok_check_if_exists_cb(GtkWidget *bu
 }
 
 #if !GTK_CHECK_VERSION(2,4,0) /* FILECHOOSER */
-static void
+static gboolean
 file_cancel_cb(PidginRequestData *data)
 {
 	generic_response_start(data);
@@ -1514,6 +1515,7 @@ file_cancel_cb(PidginRequestData *data)
 		((PurpleRequestFileCb)data->cbs[0])(data->user_data, NULL);
 
 	purple_request_close(data->type, data);
+	return FALSE;
 }
 #endif /* FILECHOOSER */
 
============================================================
--- pidgin/gtkscrollbook.c	a00c4006cadb2125aea25639d5a8317cd36d63a1
+++ pidgin/gtkscrollbook.c	e7b74f63160c60acbf3d2262822c1de1a1941872
@@ -64,7 +64,7 @@ pidgin_scroll_book_get_type (void)
 	return scroll_book_type;
 }
 
-static void
+static gboolean
 scroll_left_cb(PidginScrollBook *scroll_book)
 {
 	int index;
@@ -72,9 +72,10 @@ scroll_left_cb(PidginScrollBook *scroll_
 
 	if (index > 0)
 		gtk_notebook_set_current_page(GTK_NOTEBOOK(scroll_book->notebook), index - 1);
+	return TRUE;
 }
 
-static void
+static gboolean
 scroll_right_cb(PidginScrollBook *scroll_book)
 {
 	int index, count;
@@ -87,6 +88,7 @@ scroll_right_cb(PidginScrollBook *scroll
 
 	if (index + 1 < count)
 		gtk_notebook_set_current_page(GTK_NOTEBOOK(scroll_book->notebook), index + 1);
+	return TRUE;
 }
 
 static void
@@ -136,10 +138,11 @@ page_count_change_cb(PidginScrollBook *s
 	refresh_scroll_box(scroll_book, index, count);
 }
 
-static void
+static gboolean
 scroll_close_cb(PidginScrollBook *scroll_book)
 {
 	gtk_widget_destroy(gtk_notebook_get_nth_page(GTK_NOTEBOOK(scroll_book->notebook), gtk_notebook_get_current_page(GTK_NOTEBOOK(scroll_book->notebook))));
+	return FALSE;
 }
 
 static void
============================================================
--- pidgin/gtkstatusbox.c	6d5668bee41a0d828d744f06d432fc88d14f6572
+++ pidgin/gtkstatusbox.c	fbda7c09dfecdba393caf465c447d3b093159ba2
@@ -1100,7 +1100,7 @@ static gboolean imhtml_scroll_event_cb(G
 	return TRUE;
 }
 
-static int imhtml_remove_focus(GtkWidget *w, GdkEventKey *event, PidginStatusBox *status_box)
+static gboolean imhtml_remove_focus(GtkWidget *w, GdkEventKey *event, PidginStatusBox *status_box)
 {
 	if (event->keyval == GDK_Tab || event->keyval == GDK_KP_Tab)
 	{


More information about the Commits mailing list