/pidgin/main: b5fdc251ed2e: win32: don't kill children, when req...

Tomasz Wasilczyk tomkiewicz at cpw.pidgin.im
Wed May 15 13:55:17 EDT 2013


Changeset: b5fdc251ed2eb54e273c2fcb5d360bd1f2887240
Author:	 Tomasz Wasilczyk <tomkiewicz at cpw.pidgin.im>
Date:	 2013-05-15 19:55 +0200
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/b5fdc251ed2e

Description:

win32: don't kill children, when request dialog gets closed

diffstat:

 pidgin/gtkrequest.c |  25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diffs (42 lines):

diff --git a/pidgin/gtkrequest.c b/pidgin/gtkrequest.c
--- a/pidgin/gtkrequest.c
+++ b/pidgin/gtkrequest.c
@@ -1747,6 +1747,26 @@ pidgin_request_folder(const char *title,
 	return (void *)data;
 }
 
+#ifdef _WIN32
+
+/* Not needed (yet) for non-win32, but should work everywhere. */
+static void
+pidgin_window_detach_children(GtkWindow* parent)
+{
+	GList *it;
+
+	g_return_if_fail(parent != NULL);
+
+	it = gtk_window_list_toplevels();
+	for (it = g_list_first(it); it != NULL; it = g_list_next(it)) {
+		GtkWindow *win = GTK_WINDOW(it->data);
+		if (gtk_window_get_transient_for(win) == parent)
+			gtk_window_set_transient_for(win, NULL);
+	}
+}
+
+#endif
+
 static void
 pidgin_close_request(PurpleRequestType type, void *ui_handle)
 {
@@ -1754,6 +1774,11 @@ pidgin_close_request(PurpleRequestType t
 
 	g_free(data->cbs);
 
+#ifdef _WIN32
+	/* Win32 gtk ignores gtk_window_set_destroy_with_parent(..., FALSE). */
+	pidgin_window_detach_children(GTK_WINDOW(data->dialog));
+#endif
+
 	gtk_widget_destroy(data->dialog);
 
 	if (type == PURPLE_REQUEST_FIELDS)



More information about the Commits mailing list