From 44566e1ed03d07991280f8652edc27f85b14ae73 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 27 Jun 2009 22:02:51 +0000 Subject: [PATCH] use the top level window parent as argument to gtk_window_set_transient_for() to fix GTK errors/crashes (closes #10929) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@61219 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/fontdlg.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gtk/fontdlg.cpp b/src/gtk/fontdlg.cpp index f6059b9e63..af97ee1d92 100644 --- a/src/gtk/fontdlg.cpp +++ b/src/gtk/fontdlg.cpp @@ -108,8 +108,14 @@ bool wxFontDialog::DoCreate(wxWindow *parent) m_widget = gtk_font_selection_dialog_new( wxGTK_CONV( m_message ) ); if (parent) - gtk_window_set_transient_for(GTK_WINDOW(m_widget), - GTK_WINDOW(parent->m_widget)); + { + GtkWidget *gtktlw = gtk_widget_get_toplevel(parent->m_widget); + if ( gtktlw ) + { + gtk_window_set_transient_for(GTK_WINDOW(m_widget), + GTK_WINDOW(gtktlw)); + } + } GtkFontSelectionDialog *sel = GTK_FONT_SELECTION_DIALOG(m_widget);