diff --git a/src/gtk/filedlg.cpp b/src/gtk/filedlg.cpp index 500acf64ef..1293d32fd3 100644 --- a/src/gtk/filedlg.cpp +++ b/src/gtk/filedlg.cpp @@ -155,7 +155,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message, GtkFileChooserAction gtk_action; GtkWindow* gtk_parent = NULL; if (parent) - gtk_parent = GTK_WINDOW(parent->m_widget); + gtk_parent = GTK_WINDOW( gtk_widget_get_toplevel(parent->m_widget) ); gchar* ok_btn_stock; if ( style & wxSAVE ) diff --git a/src/gtk1/filedlg.cpp b/src/gtk1/filedlg.cpp index 500acf64ef..1293d32fd3 100644 --- a/src/gtk1/filedlg.cpp +++ b/src/gtk1/filedlg.cpp @@ -155,7 +155,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message, GtkFileChooserAction gtk_action; GtkWindow* gtk_parent = NULL; if (parent) - gtk_parent = GTK_WINDOW(parent->m_widget); + gtk_parent = GTK_WINDOW( gtk_widget_get_toplevel(parent->m_widget) ); gchar* ok_btn_stock; if ( style & wxSAVE )